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

This commit is contained in:
NFish 2024-08-01 12:57:30 +08:00 committed by GitHub
parent f6e8e120a1
commit 9c4f3be0f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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} />
{