fix: allow drag-to-pan over diagram nodes and compounds
Previously onPointerDown bailed out when the target was inside a node (data-node-id), blocking pan entirely over nodes and compound groups. Now panning always starts, and a didPan ref distinguishes drag from click — node click handlers skip selection when the user was dragging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -152,8 +152,12 @@ export function ProcessDiagram({
|
||||
);
|
||||
|
||||
const handleNodeClick = useCallback(
|
||||
(nodeId: string) => { onNodeSelect?.(nodeId); },
|
||||
[onNodeSelect],
|
||||
(nodeId: string) => {
|
||||
// Suppress click if the pointer gesture was a drag (pan)
|
||||
if (zoom.didPan.current) return;
|
||||
onNodeSelect?.(nodeId);
|
||||
},
|
||||
[onNodeSelect, zoom.didPan],
|
||||
);
|
||||
|
||||
const handleNodeDoubleClick = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user