From e4259a8f13984008aff127f5e5afb34c5e43021e Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Thu, 20 Jun 2024 15:08:12 +0800 Subject: [PATCH] fix: workflow note node copy & link style (#5428) --- web/app/components/workflow/index.tsx | 15 +++++++++++++-- .../note-node/note-editor/theme/theme.css | 6 +++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx index 23807e36ff..79e681b561 100644 --- a/web/app/components/workflow/index.tsx +++ b/web/app/components/workflow/index.tsx @@ -66,6 +66,7 @@ import { getKeyboardKeyCodeBySystem, initialEdges, initialNodes, + isEventTargetInputArea, } from './utils' import { CUSTOM_NODE, @@ -217,8 +218,18 @@ const Workflow: FC = memo(({ useKeyPress('delete', handleNodesDelete) useKeyPress(['delete', 'backspace'], handleEdgeDelete) - useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.c`, handleNodesCopy, { exactMatch: true, useCapture: true }) - useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.v`, handleNodesPaste, { exactMatch: true, useCapture: true }) + useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.c`, (e) => { + if (isEventTargetInputArea(e.target as HTMLElement)) + return + + handleNodesCopy() + }, { exactMatch: true, useCapture: true }) + useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.v`, (e) => { + if (isEventTargetInputArea(e.target as HTMLElement)) + return + + handleNodesPaste() + }, { exactMatch: true, useCapture: true }) useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.d`, handleNodesDuplicate, { exactMatch: true, useCapture: true }) useKeyPress(`${getKeyboardKeyCodeBySystem('alt')}.r`, handleStartWorkflowRun, { exactMatch: true, useCapture: true }) diff --git a/web/app/components/workflow/note-node/note-editor/theme/theme.css b/web/app/components/workflow/note-node/note-editor/theme/theme.css index 8c42757c30..a256bc3199 100644 --- a/web/app/components/workflow/note-node/note-editor/theme/theme.css +++ b/web/app/components/workflow/note-node/note-editor/theme/theme.css @@ -15,8 +15,12 @@ } .note-editor-theme_link { - text-decoration: underline; cursor: pointer; + color: #155eef; +} + +.note-editor-theme_link:hover { + text-decoration: underline; } .note-editor-theme_text-strikethrough {