-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"free" event doesn't fire if u right click during drag and drop #3005
Comments
This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
Please provide a reproducible test case according to the issue template, including a code sample that reproduces the issue. A JSBin can be forked to easily provide a code sample. You may want to log events or show them in a div and demonstrate how they may violate your expectations. A GIF or video would also help |
This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
as you asked, I created a simple example that can reproduce the problem, you can find it here JSBin. as you can see, if you drag and free a node, it will log on the left using the event cy.on("free",...), but if you right click during the drag, the node will be freed without firing the above-mentioned event ( and so it won't log ). hope it can be of any help |
I tried your demo. It seems like there's the assumption that the user is cancelling the gesture by pressing the right mouse button. So, the node isn't explicitly freed by the user. So, there's a few things to consider: (1) There's not currently a cancellation event for dragging. It's not clear that cancelling should be the same event as a user-intended 'free' event. If it's always the same event, how do you tell the difference? (2) When the cancellation occurs should be carefully considered. It could be on the second button's 'mousedown' or on its 'mouseup'. (3) Cancellation doesn't seem to be possible on some devices, like the on the Mac trackpad. An analogous case may be pressing with a second finger on touch devices, like the iPad. (4) Given that this seems to be a request for some sort of new drag cancelling support with new events -- see (1) -- this may be something that should be planned as a new feature rather than as something included in a patch release. (5) There's accessibility to consider. It could be that we shouldn't support cancellation at all. If someone isn't very dextrous with a mouse, it's easy to accidentally hit the extra right mouse button while dragging. In that case, it might be better to ignore the right mouse button rather than cancelling. As in (3), if we go this way, the behaviour should be made consistent for touch device users. |
Thanks for your considerations, do you think this behavior can be fixed in an upcoming release, as you explained in (5)? |
This issue has been automatically marked as stale, because it has not had activity within the past 14 days. It will be closed if no further activity occurs within the next 7 days. If a feature request is important to you, please consider making a pull request. Thank you for your contributions. |
Let’s simplify this to consider only the mouse events. The touch case is more complex, and it seems qualitatively different after some analysis. So, basically the new behaviour would be this: If we’re in the middle of a desktop (i.e. mouse) drag gesture, then all right mouse button events should be ignored. |
@chrtannus, would you take a look at this one? |
Environment info
Current (buggy) behaviour
as per title, if you right click with mouse during drag and drop, the node will be set free without firing the event "free".
Desired behaviour
the free event should be fired aniway
Minimum steps to reproduce
start dragging a node e right click before drop.
The text was updated successfully, but these errors were encountered: