use-gesture: Swiping does not always work
Describe the bug For some strange reason swiping parameter using drag only works with a mouse and not on an iPhone and sometimes very hard to do using a trackpad on a Mac. Swipe always returns [0,0]. I have tried different options without much success. Works perfectly on Chrome on desktop using a mouse.
Sandbox or Video https://codesandbox.io/s/rough-bird-33uu4?file=/src/App.js
Information:
- React Use Gesture version: tried v9.0.0-beta.11 and 8.0.1
- Device: iPhone Xs and Macbook Pro
- OS: iOS 14.3
- Browser: Mobile Safari, Chrome
Checklist:
- I’ve read the documentation.
- If this is an issue with drag, I’ve tried setting
touch-action: none
to the draggable element.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 37 (1 by maintainers)
Commits related to this issue
- fix: attempt at fixing #249 — committed to pmndrs/use-gesture by dbismut 4 years ago
@mark-night @spoldman I’ve released 9.0.0-beta.14 that attempts at fixing this. Can you please try the same sandbox and report the logs once more? https://codesandbox.io/s/vibrant-hugle-le03d
Thanks so much for your help, much appreciated.
As soon as I release the 9.0.0 version I’ll close pending issues.
I was having the same issue described here but
9.0.0-beta.14
has solved it. It seems safe to close the issue.Always nice to hear! Let me know if there’s anything else not working for you. Should be able to release v9 in the next few days. Cheers!
Sorry forgot to expand the log.
vx
does have the same value asmanualVX
, except the last gesture frame for every swipe, wheremanualVX
is 0 whilevx
has the same value as previous gesture frame. As you’ve explained this earlier, I guess it doesn’t matter. I don’t feel anything broken.manualVX
does give Infinity on every first gesture frame whilevx
doesn’t. Again, I don’t see anything broken due to that neither.Never mind, was able to find out (
npm view
) it’s the@next
tag@dbismut @spoldman
If I disable iPhone’s 3D Touch setting (Settings/Accessibility/Touch/3D & Haptic Touch/3D Touch), then swipe works as perfect as on desktop browser.
Don’t know if this can be tweaked/opt-out by some logic within the library, as you can not assume user has the feature turned off. Most won’t, I guess.