-
First off, great library! In chrome both pinch and wheel gestures are called for ctrl+wheel and trackpad pinch inputs. In safari only the wheel gesture is called on ctrl+wheel, and only pinch on trackpad. Is this intentional and if so how do you suggest handling an action like zoom when it'll be called twice in chrome (pinch + wheel), but only once in safari (wheel for ctrl+wheel and pinch for trackpad pinch). |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
This is sort of intentional indeed. When using the trackpad in MacBooks or the Magic Trackpad, Safari is able to determine both zoom and rotation through vendor-specific This is not the lib doing anything, this is just the way it is. However if you want to distinguish wheel from zoom, you can always check state.pinching inside your |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick reply! Ohh ok, I understand. I guess in my case the issue isn't distinguishing wheel from zoom it's just that pinch and wheel both get called in Chrome. So just a small example with some pseudocode of how I'm handling it now
So in Chrome handleZoom will get called twice, once in the wheel handler and once in the pinch handler for either a trackpad pinch or a |
Beta Was this translation helpful? Give feedback.
-
As a simple example I forked this sandbox from one of your examples https://codesandbox.io/s/red-wood-o90q7m?file=/src/App.jsx . If you ctrl+wheel or trackpad pinch on Chrome you will get both the wheel and pinch logs in the console. Could this possibly be a regression? I was looking through some of the old issues and found one that is similar or the same as this, but it was resolved back in 2019. #80 (comment) |
Beta Was this translation helpful? Give feedback.
-
@dbismut It seems like v9 used to only send pinch events in Chrome on |
Beta Was this translation helpful? Give feedback.
@dbismut It seems like v9 used to only send pinch events in Chrome on
ctrl+wheel
or trackpad pinch in Chrome https://codesandbox.io/s/react-use-gesture-issue-wheel-forked-pmlqou?file=/src/index.js