mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-03 19:57:37 +08:00
Fix keyboard shortcut conflict between workflow and browser (#6863)
This commit is contained in:
parent
f6e8e120a1
commit
9c4f3be0f3
@ -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} />
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user