Distinguish between click and drag
See original GitHub issueNow every click triggers both onStart and onEnd.
It would be nice if I could specify maximum mouse offset and/or timeout until which drag operation will not start.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:26
- Comments:24
Top Results From Across the Web
javascript - How to distinguish mouse "click" and "drag"
I updated the answer with an explanation. Basically if your finger less than 6 pixels, it will still count as a click. If...
Read more >Differentiate between a Click and Swipe/Drag event in React
First, let us consider what makes a click different from a swipe. Both involve a mousedown and mouseup action but a swipe involves...
Read more >Distinguish between click / drag - Questions - Babylon.js
Drag is a state that you can get from your pointer down and pointer up. while pointer down is triggered, and before pointer...
Read more >Drag'n'Drop with mouse events
Summary · Events flow: ball.mousedown → document.mousemove → ball. · At the drag start – remember the initial shift of the pointer relative...
Read more >Distinguish between click and drag · Issue #350
For regular onClick to occur it is enough to have 'mousedown' and 'mouseup' on thee same element. So with draggable there is ambiguity...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Since every click fires the
onStartandonStopcallbacks we can set a flagonDragso we know we’re dragging and check itonStop, like so:@yjaju Hey! I used
onStopincorrectly and returned false in my implementation… so that was my problem. But thank you anyway!😃