Skip to content

useDrag with mouse only #646

Answered by dbismut
manelio asked this question in General
Jan 4, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

The doc doesn't say anything about disabling events for touch devices.

https://use-gesture.netlify.app/docs/options/#pointertouch

Most 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.

So it's not disabling anything it's just merely toggling between using PointerEvents and TouchEvents.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@manelio
Comment options

@dbismut
Comment options

Answer selected by manelio
@dbismut
Comment options

@manelio
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants