With this code, touch* events are still being fired.
\nCan anyone shed some light on this?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The doc doesn't say anything about disabling events for touch devices.
\nhttps://use-gesture.netlify.app/docs/options/#pointertouch
\n\n\nMost gestures, drag included, use pointer events. This works well in 99 situations in 100, but pointer events get canceled on touch devices when the user starts scrolling. Usually this is what you actually want, and the browser does it for you. But in some situations you may want the drag to persist while scrolling. In that case you'll need to indicate 🤙 @use-gesture to use touch events, which aren't canceled on scroll.
\n
So it's not disabling anything it's just merely toggling between using PointerEvents
and TouchEvents
.
-
I don't know if this is the expected behavior, but I need for my use case useDrag to work only with mouse and not with touch devices.
With this code, touch* events are still being fired. Can anyone shed some light on this? |
Beta Was this translation helpful? Give feedback.
-
Did you read the documentation? |
Beta Was this translation helpful? Give feedback.
The doc doesn't say anything about disabling events for touch devices.
https://use-gesture.netlify.app/docs/options/#pointertouch
So it's not disabling anything it's just merely toggling between using
PointerEvents
andTouchEvents
.