Skip to content

Commit

Permalink
feat: Support shortcut keys to delete nodes infiniflow#3283
Browse files Browse the repository at this point in the history
  • Loading branch information
cike8899 committed Nov 8, 2024
1 parent f16ef57 commit b72c368
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions web/src/pages/flow/canvas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { Operator } from '../constant';
import FlowDrawer from '../flow-drawer';
import {
useHandleDrop,
useHandleKeyUp,
useSelectCanvasData,
useShowDrawer,
useValidateConnection,
Expand Down Expand Up @@ -87,7 +86,6 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {

const { onDrop, onDragOver, setReactFlowInstance } = useHandleDrop();

const { handleKeyUp } = useHandleKeyUp();
useWatchNodeFormDataChange();

return (
Expand Down Expand Up @@ -127,7 +125,7 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {
onNodeClick={onNodeClick}
onPaneClick={onPaneClick}
onInit={setReactFlowInstance}
onKeyUp={handleKeyUp}
// onKeyUp={handleKeyUp}
onSelectionChange={onSelectionChange}
nodeOrigin={[0.5, 0]}
isValidConnection={isValidConnection}
Expand All @@ -142,6 +140,7 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {
stroke: 'rgb(202 197 245)',
},
}}
deleteKeyCode={['Delete', 'Backspace']}
>
<Background />
<Controls />
Expand Down

0 comments on commit b72c368

Please sign in to comment.