diff --git a/apps/builder/src/features/graph/components/Graph.tsx b/apps/builder/src/features/graph/components/Graph.tsx index 7cf7fc398..9a8f63571 100644 --- a/apps/builder/src/features/graph/components/Graph.tsx +++ b/apps/builder/src/features/graph/components/Graph.tsx @@ -23,7 +23,6 @@ import { isSelectBoxIntersectingWithElement } from '../helpers/isSelectBoxInters import { useGroupsStore } from '../hooks/useGroupsStore' import { useShallow } from 'zustand/react/shallow' import { projectMouse } from '../helpers/projectMouse' -import { useKeyboardShortcuts } from '@/hooks/useKeyboardShortcuts' import { useUser } from '@/features/account/hooks/useUser' import { GraphNavigation } from '@typebot.io/prisma' @@ -305,8 +304,6 @@ export const Graph = ({ setAutoMoveDirection(undefined) } - useKeyboardShortcuts({}) - useEventListener('keydown', (e) => { if (e.key === ' ') setIsDraggingGraph(true) }) @@ -317,6 +314,16 @@ export const Graph = ({ } }) + useEventListener( + 'blur', + () => { + setIsDraggingGraph(false) + setIsDragging(false) + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + window as any + ) + useEventListener('mousedown', handleCaptureMouseDown, undefined, { capture: true, })