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
parent 6021ca5c31
commit a355225a83
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}