'How can I pass touch events to react-draggable
I'm currently using react-draggable to implement resizing table columns see example: https://codesandbox.io/s/j30k46l7xw
This is not working on most mobile devices nor the devtools
I was wondering if there is a way for react-draggable to accept touch events. I went through the repo docs and issues and it seems like it's been implemented. I just can't figure it out
Solution 1:[1]
I think react draggable will get confused if you are using onClick event on its parent div/component
use onTouchStart along with onClick event
onClick={(e) => handleSomething(e)}
onTouchStart={(e) => handleSomething(e)}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Rugved Patel |