Browse Source

fix: workflow delete node shortcut (#7076)

zxhlyh 8 months ago
parent
commit
1571a8afd4
1 changed files with 6 additions and 1 deletions
  1. 6 1
      web/app/components/workflow/index.tsx

+ 6 - 1
web/app/components/workflow/index.tsx

@@ -264,7 +264,12 @@ const Workflow: FC<WorkflowProps> = memo(({
 
   const { shortcutsEnabled: workflowHistoryShortcutsEnabled } = useWorkflowHistoryStore()
 
-  useKeyPress(['delete', 'backspace'], handleNodesDelete)
+  useKeyPress(['delete', 'backspace'], (e) => {
+    if (isEventTargetInputArea(e.target as HTMLElement))
+      return
+
+    handleNodesDelete()
+  })
   useKeyPress(['delete', 'backspace'], handleEdgeDelete)
   useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.c`, (e) => {
     if (isEventTargetInputArea(e.target as HTMLElement))