mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-27 12:04:49 +02:00
[eric] canvas: pan handler ignores portal-bubbled clicks, dialog inputs opened from canvas components are clickable again
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user