diff --git a/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts b/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts index e098fb11..0e82d496 100644 --- a/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts +++ b/frontend/src/app/pages/Dashboard/hooks/interaction/useCanvasControls.ts @@ -481,6 +481,10 @@ export function useCanvasControls( }, [enabled, applyLive, commitLive]); const handleMouseDown = useCallback((e: React.MouseEvent) => { + // Portaled children (MuiDialog/Menu opened from canvas-hosted components) bubble through the REACT + // tree, not the DOM: without this guard their clicks started a canvas pan and the preventDefault + // killed input focus (the "can't click into the Add-connector fields" bug). + if (e.currentTarget instanceof Node && e.target instanceof Node && !e.currentTarget.contains(e.target)) return; e.preventDefault(); cancelAnimation(); cancelInertia();