Detecting touch taps and double taps while using react-draggable
See original GitHub issueI’m using this great library to add dragging functionality to components and it works great. However, I have the following issue:
-
Before I was using this library, I could capture the standard click and double click events and they would work for both mouse and touch devices
domNode.addEventListener('click', (event) => {}); domNode.addEventListener('dblclick', (event) => {});
-
But now that I’m using this library, the click and dblclick events are only being triggered for mouse inputs, but not for touch devices, how can I detect touch taps and double taps while using this library?
thank you 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Detect Multiple Touches in React Native with the Gesture ...
In this video you'll be introduced to React Native's Gesture Responder System by creating a component to detect n number of presses.
Read more >React Native Gesture Handler: Swipe, long-press, and more
With TapGestureHandler , we can implement both single- and double-tap gestures. Let's start with single-tap gesture and then move on to a double ......
Read more >Taps, drags, and other gestures - Flutter documentation
This document explains how to listen for, and respond to, gestures in Flutter. Examples of gestures include taps, drags, and scaling. The gesture...
Read more >How do you detect a double tap drag? - Stack Overflow
You can use GestureDetector.OnDoubleTapListener to detect the double tap gesture and trigger a flag. Then on your onTouch (MotionEvent.
Read more >Gesture options - @use-gesture documentation
tapsThreshold, drag, Customize the displacement triggering taps when using the ... If true , drag and pinch will use touch events on touch-enabled...
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
if someone is looking for a temporary fix, I managed to make it work with this
I also faced this issue, touch was not working in mobile screen. so I added
onTouchStart
attribute to call the functiononTouchStart={()=> clickedMe()}
Got the solution from : https://github.com/react-grid-layout/react-draggable/issues/550