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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user