timruffles / mobile-drag-drop

A drop-in shim to allow you to use existing html5 drag'n'drop code with mobile browsers
http://timruffles.github.io/mobile-drag-drop/demo/
MIT License
603 stars 150 forks source link

Add the possibility to decide if the holdToDrag delay should be applied or not #140

Closed Mboulianne closed 2 years ago

Mboulianne commented 6 years ago

Hello, I'm having a small issue on PC / laptops with a touch enabled screen.

1- When I try to drag and drop using the touch screen the holdToDrag delay is being applied. All is good and feel very natural. 2- Then I take the mouse and try to drag. The holdToDrag delay is still there and it doesn't feel natural at all. We are used to drag and drop right away with a mouse.

I'd like to have a hook that allows me to tell the polyfill if it should go on and apply the delay.

Does it make sense to you?

reppners commented 6 years ago

Welcome :)

So your PC is emulating touch events when using the mouse? Thats basically the issue. If you're using a mouse there should be mouse events. The polyfill only picks up on touch events.

Theres two options

EDIT: Theres a third variant. Refactor this polyfill to pick up on pointer events, too. Maybe your browser has full support for pointer events and will enable to discern mouse from touch events.

reppners commented 2 years ago

Closing because as of now this is non-actionable. Will reopen if discussion leads to actionable outcome.