[eric] canvas: pan handler ignores portal-bubbled clicks, dialog inputs opened from canvas components are clickable again

This commit is contained in:
ciregenz
2026-08-05 16:36:33 -07:00
parent 8e9d45b374
commit fe4b63d8b2
@@ -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();