From 49636be0e96133044ca575b04ac6d6de7fda0082 Mon Sep 17 00:00:00 2001 From: Fabian Bieler Date: Thu, 28 Jul 2022 11:22:47 +0200 Subject: [PATCH] fix(validation): Remove css-classes if mouse moves directly to different handle. If two handles are next to each other or overlap it is possible for the mouse-cursor to move from one handle to the other without a mouse-move-event being fired where isHoveringHandle is false. Thus, the valid and connecting css-classes were not removed from the handle. This commit fixes this. --- src/components/Handle/handler.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Handle/handler.ts b/src/components/Handle/handler.ts index 6e03da96..ca0fe8d7 100644 --- a/src/components/Handle/handler.ts +++ b/src/components/Handle/handler.ts @@ -153,6 +153,7 @@ export function handleMouseDown({ } if (connection.source !== connection.target && elementBelow) { + resetRecentHandle(recentHoveredHandle); recentHoveredHandle = elementBelow; elementBelow.classList.add('react-flow__handle-connecting'); elementBelow.classList.toggle('react-flow__handle-valid', isValid);