fix: node shortcuts active in input fields (#3438)

This commit is contained in:
Pascal M 2024-04-13 03:48:39 +02:00 • committed by GitHub
commit a355225a83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 39 additions and 2 deletions

View file

@ -125,7 +125,11 @@ const Workflow: FC<WorkflowProps> = memo(({
handleEdgeDelete,
handleEdgesChange,
} = useEdgesInteractions()
const { isValidConnection } = useWorkflow()
const {
isValidConnection,
enableShortcuts,
disableShortcuts,
} = useWorkflow()
useOnViewportChange({
onEnd: () => {
@ -161,6 +165,8 @@ const Workflow: FC<WorkflowProps> = memo(({
edgeTypes={edgeTypes}
nodes={nodes}
edges={edges}
onPointerDown={enableShortcuts}
onMouseLeave={disableShortcuts}
onNodeDragStart={handleNodeDragStart}
onNodeDrag={handleNodeDrag}
onNodeDragStop={handleNodeDragStop}