From 1571a8afd4679105db5bdd063afe5cbd9c830a23 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Thu, 8 Aug 2024 10:42:08 +0800 Subject: [PATCH] fix: workflow delete node shortcut (#7076) --- web/app/components/workflow/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx index 34c7fc4dcc..c06e1b9524 100644 --- a/web/app/components/workflow/index.tsx +++ b/web/app/components/workflow/index.tsx @@ -264,7 +264,12 @@ const Workflow: FC = 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))