Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Fix keyboard shortcut conflict between workflow and browser (#6863)

NFish9c4f3be0f3b3
diff --git a/web/app/components/workflow/index.tsx b/web/app/components/workflow/index.tsx
index 0f69b56840b..345ed46ff07 100644
--- a/web/app/components/workflow/index.tsx
+++ b/web/app/components/workflow/index.tsx
@@ -194,6 +194,10 @@ const Workflow: FC<WorkflowProps> = memo(({
e.preventDefault()
if ((e.key === 'z' || e.key === 'Z') && (e.ctrlKey || e.metaKey))
e.preventDefault()
+ if ((e.key === 'y' || e.key === 'Y') && (e.ctrlKey || e.metaKey))
+ e.preventDefault()
+ if ((e.key === 's' || e.key === 'S') && (e.ctrlKey || e.metaKey))
+ e.preventDefault()
})
useEventListener('mousemove', (e) => {
const containerClientRect = workflowContainerRef.current?.getBoundingClientRect()
@@ -260,7 +264,7 @@ const Workflow: FC<WorkflowProps> = memo(({
const { shortcutsEnabled: workflowHistoryShortcutsEnabled } = useWorkflowHistoryStore()
- useKeyPress('delete', handleNodesDelete)
+ useKeyPress(['delete', 'backspace'], handleNodesDelete)
useKeyPress(['delete', 'backspace'], handleEdgeDelete)
useKeyPress(`${getKeyboardKeyCodeBySystem('ctrl')}.c`, (e) => {
if (isEventTargetInputArea(e.target as HTMLElement))
@@ -310,7 +314,7 @@ const Workflow: FC<WorkflowProps> = memo(({
>
<SyncingDataModal />
<CandidateNode />
- <Header/>
+ <Header />
<Panel />
<Operator handleRedo={handleHistoryForward} handleUndo={handleHistoryBack} />
{