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.
This commit is contained in:
Fabian Bieler
2022-07-28 11:41:16 +02:00
parent a9f22d8a1b
commit 49636be0e9
+1
View File
@@ -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);