Skip to content
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

Merged
merged 3 commits into from
Oct 28, 2018

Conversation

ndbroadbent
Copy link

Just a few changes that I needed

@felipemfp
Copy link

@zyzo, what do you think? Almost a year...

@Venryx
Copy link

Venryx commented Oct 23, 2018

Any update? Would be nice to have the right-clicks ignored.

@zyzo
Copy link
Owner

zyzo commented Oct 23, 2018

yeah seems cool, I'll take a look this weekend

@zyzo zyzo changed the base branch from master to 1.0.0-rc.1 October 28, 2018 20:11
@zyzo zyzo merged commit 4e4987e into zyzo:1.0.0-rc.1 Oct 28, 2018
@zyzo
Copy link
Owner

zyzo commented Oct 28, 2018

Released in 1.0.0-rc.1. Thanks @ndbroadbent for the PR

@qtsd
Copy link

qtsd commented Oct 31, 2018

Ignoring the right mouse button is great, but what's the point about preventing click event after an item has been dragged ?

qtsd added a commit to qtsd/react-dnd-mouse-backend that referenced this pull request Oct 31, 2018
This reverts commit 4e4987e, reversing
changes made to a2d3a3c.
src/MouseBackend.js Show resolved Hide resolved
@@ -195,6 +210,16 @@ export default class MouseBackend {
this.actions.endDrag()
}

handleWindowClick(e) {
if (this.preventClick) e.stopPropagation()
Copy link
Author

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.

zyzo pushed a commit that referenced this pull request Feb 17, 2019
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
zyzo pushed a commit that referenced this pull request Feb 17, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants