From ce0bbb3dc9100e2ff10bbb97fb203ed9358dfeda Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 12 Mar 2026 07:27:40 +0000 Subject: [PATCH] Check e.buttons to block hover events during any mouse-down drag The isDraggingNodeRef check had a race condition: fast mouse movement could trigger onMouseEnter before React Flow's onNodeDragStart fired. Adding e.buttons !== 0 catches all cases where a button is held, which is always true during drag, with no timing dependency. https://claude.ai/code/session_01MvD1n4QeXutgwUpKJuDGHa --- src/components/nodes/BaseNode.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/nodes/BaseNode.tsx b/src/components/nodes/BaseNode.tsx index 40288b53..51a2135b 100644 --- a/src/components/nodes/BaseNode.tsx +++ b/src/components/nodes/BaseNode.tsx @@ -296,12 +296,12 @@ export function BaseNode({ ${!fullBleed && selected && settingsExpanded ? "border-blue-500" : ""} ${className} `} - onMouseEnter={() => { - if (isPanningRef.current || isDraggingNodeRef.current) return; + onMouseEnter={(e) => { + if (e.buttons !== 0 || isPanningRef.current || isDraggingNodeRef.current) return; setHoveredNodeId(id); }} - onMouseLeave={() => { - if (isPanningRef.current || isDraggingNodeRef.current) return; + onMouseLeave={(e) => { + if (e.buttons !== 0 || isPanningRef.current || isDraggingNodeRef.current) return; setHoveredNodeId(null); }} >