desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 387 forks source link

Noticeable delay before dragEnd is triggered #162

Closed marckohlbrugge closed 7 years ago

marckohlbrugge commented 7 years ago

There seems to be a noticeable delay between when the user releases their mouse button and the dragEnd is triggered.

This happens in the demos: https://codepen.io/desandro/pen/yyRapr

You can see it takes a while between releasing the mouse button and the square turning orange again.

The same happens for the pointerUp event: https://codepen.io/desandro/pen/zxmKQq

My best guess is that this is intentional. Maybe it's related to differentiating between static clicks and dragging, although I don't see the logic for this on the end of a drag (versus beginning of drag).

Is there a way to configure or modify draggabilly such that dragEnd is immediately triggered when the user releases their mouse button?

I'm implementing a "snap to the side of viewport" feature and having the delay is a bit weird.

marckohlbrugge commented 7 years ago

For what's it's worth this is what I'm creating: https://twitter.com/marckohlbrugge/status/881664950346842113

Works great on iOS. No delay for some reason.

desandro commented 7 years ago

Thanks for reporting this issue! I don't feel I'm able to reproduce this delay on my own. Upon releasing mousedown, dragEnd is triggered immediately.

There is no intentional delay built into the dragEnd behavior.

I'll keep this issue open in case others encounter it as well. Maybe I'm missing something.

marckohlbrugge commented 7 years ago

I typically use 'three finger drag' to drag stuff around. I just tried the regular 'click, hold and drag' method and that does indeed seem to work as expected.

It's strange macOS treats these two methods differently, but I'm sure there's a valid reason. Either way, I imagine most people use the regular method in which case it's not much of an issue.

Closing the thread :)