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

Drag events supersede click events #68

Closed
rickghome opened this issue Oct 12, 2017 · 7 comments
Closed

Drag events supersede click events #68

rickghome opened this issue Oct 12, 2017 · 7 comments
Labels
bug unintended behaviour

Comments

@rickghome
Copy link

Bug, documentation issue, user error?

I have an element that may become 'active' if clicked by the user. I also want to allow that element to be draggable. Currently, it seems that drag events are superseding click events (and in this case, impedes them, regardless of binding order). It's essential to my user experience that click events precede drag events. I'm guessing this isn't an edge-case.

@tsov tsov added the bug unintended behaviour label Oct 13, 2017
@tsov
Copy link
Member

tsov commented Oct 13, 2017

I can reproduce. You could use the delay option to delay the drag action (for now). It works for Draggable, Sortable, Swappable and Droppable.

new Sortable(containers, {
  delay: 200,
});

// or

new Draggable(containers, {
  delay: 200,
});

This is not ideal nor obvious. Will look for a better solution 👍 thanks for reporting

@rolandasb
Copy link

I have the same issue.

Adding delay helps with clicking, but if I try to drag without waiting a bit, I get strange "ghosting" effect, where mirror element gets stuck to the cursor and does not disappear.

Here's gif: https://i.imgur.com/b0zwVkk.gifv

@tsov
Copy link
Member

tsov commented Oct 26, 2017

@rbarysas yes, this seems to be an issue with the current mouse sensor, it needs to prevent native drag elements (images and links) if the delay is bigger.

This is fixed with a general sensor refactor for the upcoming v1.0.0-beta.3 release, commit is here: 7432c9a

I will leave this open until we release the new beta.

@rolandasb
Copy link

This is awesome. Thanks for the work! 👏

@tsov
Copy link
Member

tsov commented Nov 1, 2017

@rickghome can you confirm if your problem persists in the new beta release?

@rbarysas your issue should be fixed now!

@rickghome
Copy link
Author

rickghome commented Nov 1, 2017 via email

@rickghome
Copy link
Author

This solves the problem. Closing this bug. Thanks for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unintended behaviour
Projects
None yet
Development

No branches or pull requests

3 participants