浏览代码

feat: Support shortcut keys to delete nodes #3283 (#3284)

### What problem does this PR solve?
feat: Support shortcut keys to delete nodes #3283

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
tags/v0.14.0
balibabu 11 个月前
父节点
当前提交
a2153d61ce
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2
    3
      web/src/pages/flow/canvas/index.tsx

+ 2
- 3
web/src/pages/flow/canvas/index.tsx 查看文件

@@ -11,7 +11,6 @@ import { Operator } from '../constant';
import FlowDrawer from '../flow-drawer';
import {
useHandleDrop,
useHandleKeyUp,
useSelectCanvasData,
useShowDrawer,
useValidateConnection,
@@ -87,7 +86,6 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {

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

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

return (
@@ -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}
@@ -142,6 +140,7 @@ function FlowCanvas({ chatDrawerVisible, hideChatDrawer }: IProps) {
stroke: 'rgb(202 197 245)',
},
}}
deleteKeyCode={['Delete', 'Backspace']}
>
<Background />
<Controls />

正在加载...
取消
保存