Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
鍊忔槺 committed Apr 7, 2023
1 parent d69dd78 commit 97d65ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@types/react-dom": "^18.0.0",
"@types/uuid": "^9.0.1",
"@umijs/lint": "^4.0.64",
"ahooks": "^3.7.6",
"commitlint": "^17",
"commitlint-config-gitmoji": "^2",
"cross-env": "^7",
Expand Down
10 changes: 7 additions & 3 deletions src/pages/FlowEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ const FlowEditor: React.FC = () => {

const handleKeyDown = useCallback(
(event: any) => {
if (event.ctrlKey && event.code === 'KeyC') {
const ctrlKey = event.metaKey || (event.ctrlKey && !event.altKey)
if (ctrlKey && event.code === 'KeyC') {
handleCopy()
} else if (event.ctrlKey && event.code === 'KeyV') {
} else if (ctrlKey && event.code === 'KeyV') {
handlePaste(reactFlowInstance)
}
},
Expand All @@ -122,10 +123,13 @@ const FlowEditor: React.FC = () => {
fitView
snapToGrid
snapGrid={[24, 24]}
minZoom={0.1}
minZoom={0.05}
nodeTypes={nodeTypes}
deleteKeyCode={['Delete', 'Backspace']}
multiSelectionKeyCode={['Shift']}
panOnScroll
zoomOnScroll={false}
onlyRenderVisibleElements
disableKeyboardA11y={true}
onNodesChange={onNodesChange}
onEdgesChange={onEdgesChange}
Expand Down
1 change: 0 additions & 1 deletion src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ export const useAppStore = create<AppState>()(
onEdgesType: (type) => {
set(
(st) => ({
edgeType: type,
edges: st.edges.map((e) => ({
...e,
type,
Expand Down

0 comments on commit 97d65ad

Please sign in to comment.