You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a graph that uses ForceSupervisor and supports drag & drop.
When dragging a node and letting go, the forces might move it away from the cursor - but the leaveNode event isn't fired in that case, until the user manually moves the cursor.
This is a problem, for example, when applying "active" styles on a node that's being hovered or dragged - when ending the drag, the "active" styling remains on the element, although it's neither hovered nor dragged anymore.
Sigma.js version: 3.0.0-alpha3 Graphology version: 0.25.4 Operating System: Windows 10 Web browser: Electron 22.3.4 & Firefox 120.0.1
Steps to reproduce
See the CodeSandbox example, which is modified from the interactivity example found on the readme.
To reproduce the error, drag a node from the cluster out, then release without moving the cursor - it should fly back to the cluster and away from the cursor, but the leaveNode event is not fired (only the clickNode event). Moving the cursor does cause the event to be fired.
Expected behavior
The leaveNode event should fire as soon as the cursor is not in its bounds, even if the node moving is what changed.
Actual behavior
The leaveNode event is not fired until the user moves the cursor.
If this is the intended behavior, is there a good workaround to detect that the cursor is no longer on the node?
Thanks for your time, and I appreciate the effort that you've put into this awesome project!
The text was updated successfully, but these errors were encountered:
nitzanhen
changed the title
leaveNode is not fired when node is moved outside of cursor (e.g. due to a ForceSuperviser)
leaveNode is not fired when node is moved outside of cursor (e.g. due to a ForceSupervisor)
Dec 15, 2023
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Yes, this issue is very legit. It's a bit hard to solve, because of the current split between the mouse captor and the touch captor. I add the "pinned" tag so that it stays open. Thanks a lot for the report!
I have a graph that uses ForceSupervisor and supports drag & drop.
When dragging a node and letting go, the forces might move it away from the cursor - but the
leaveNode
event isn't fired in that case, until the user manually moves the cursor.This is a problem, for example, when applying "active" styles on a node that's being hovered or dragged - when ending the drag, the "active" styling remains on the element, although it's neither hovered nor dragged anymore.
Sigma.js version: 3.0.0-alpha3
Graphology version: 0.25.4
Operating System: Windows 10
Web browser: Electron 22.3.4 & Firefox 120.0.1
Steps to reproduce
See the CodeSandbox example, which is modified from the interactivity example found on the readme.
To reproduce the error, drag a node from the cluster out, then release without moving the cursor - it should fly back to the cluster and away from the cursor, but the
leaveNode
event is not fired (only theclickNode
event). Moving the cursor does cause the event to be fired.Expected behavior
The
leaveNode
event should fire as soon as the cursor is not in its bounds, even if the node moving is what changed.Actual behavior
The
leaveNode
event is not fired until the user moves the cursor.If this is the intended behavior, is there a good workaround to detect that the cursor is no longer on the node?
Thanks for your time, and I appreciate the effort that you've put into this awesome project!
The text was updated successfully, but these errors were encountered: