-
Notifications
You must be signed in to change notification settings - Fork 32
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
Prevent click event after item has been dragged, and ignore the right mouse button #7
Conversation
@zyzo, what do you think? Almost a year... |
Any update? Would be nice to have the right-clicks ignored. |
yeah seems cool, I'll take a look this weekend |
Released in |
Ignoring the right mouse button is great, but what's the point about preventing click event after an item has been dragged ? |
@@ -195,6 +210,16 @@ export default class MouseBackend { | |||
this.actions.endDrag() | |||
} | |||
|
|||
handleWindowClick(e) { | |||
if (this.preventClick) e.stopPropagation() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay in responding! The problem I was solving is that a drag would also fire a click event at the end, when the left mouse was released. My app also needed to handle click events, so it was a big problem that every drag would also fire a click at the end.
I'm not sure why this would cause problems in other apps, but the drag area or behavior might be a bit different, depending on how you use the library.
feat: - revert: Revert 'Prevent click event after item has been dragged' from (#7) #23 - revert: revert disable dragstart event preventDefault (#7) #25 docs: - add public storybook http://zyzo.github.io/react-dnd-mouse-backend/ - add NestedTargets example
feat: - revert: Revert 'Prevent click event after item has been dragged' from (#7) #23 - revert: revert disable dragstart event preventDefault (#7) #25 docs: - add public storybook http://zyzo.github.io/react-dnd-mouse-backend/ - add NestedTargets example
Just a few changes that I needed