From fe4b63d8b266654aff3d79ad1892b64291b08595 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Wed, 5 Aug 2026 16:36:33 -0700 Subject: [PATCH] [eric] canvas: pan handler ignores portal-bubbled clicks, dialog inputs opened from canvas components are clickable again --- .../pages/Dashboard/hooks/interaction/useCanvasControls.ts | 4 ++++ 1 file changed, 4 insertions(+) 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();