Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onPinch breaking on control + scroll #641

Open
Khush08 opened this issue Nov 20, 2023 · 7 comments
Open

onPinch breaking on control + scroll #641

Khush08 opened this issue Nov 20, 2023 · 7 comments
Assignees

Comments

@Khush08
Copy link

Khush08 commented Nov 20, 2023

Describe the bug

The onPinch gesture starts breaking while using control + scroll. The movement property on the onPinch state has a NaN value at the Oth index. The onPinch gesture completely stops working after that

Sandbox or Video
https://codesandbox.io/s/fancy-rgb-x959zf?file=/src/App.js

pinch.mov

Steps to reproduce - Try zooming the blue box using control + mouse scroll wheel multiple times

Information:

  • Use Gesture version: 10.2.23
  • Device: Macbook Pro
  • OS: MacOS
  • Browser: Chrome
@dbismut dbismut changed the title onPinch breaking on control + scoll onPinch breaking on control + scroll Nov 22, 2023
@dbismut
Copy link
Collaborator

dbismut commented Nov 22, 2023

I tried and can't reproduce. What mouse are you using? Not sure what I'm supposed to look at in the video btw.

@Khush08
Copy link
Author

Khush08 commented Nov 24, 2023

I am using Logitech M650. In the video I wanted to highlight that the movement[0] is assigned a NaN value on control + scroll. Once the 0th index of movement is assigned NaN, the gesture stops working

@Khush08
Copy link
Author

Khush08 commented Nov 24, 2023

Btw it is not mouse specific

@dbismut
Copy link
Collaborator

dbismut commented Nov 24, 2023

Hm in your code there is supposed to be an alert when the movement is NaN... I don't see it in the video.

@Khush08
Copy link
Author

Khush08 commented Nov 24, 2023

Hmmm, let me share a new video

use-ges-pinch.mov

@johannes-lindgren
Copy link

johannes-lindgren commented Jan 9, 2025

I am experiencing the same issue on a similar setup:

Use Gesture version: 10.3.1
Device: Macbook Pro
OS: MacOS
Browser: Chrome
Mouse: Logitech Master MX 3

When scrolling down (and vice versa for scrolling up), state.movement[0] grows incredibly large (>10^100) until it becomes NaN. It can also flip signs between callbacks, which means that even if you clamp the value, the zoom can swap between zoomed-out and zoomed-in very fast, causing flicker.

@johannes-lindgren
Copy link

johannes-lindgren commented Jan 10, 2025

In the following screenshot, I log the state.movement[0], and scroll slowly. Notice how it alternates between positive and negative values:

image

In the next screenshot, I have been scrolling fast. Notice how large the values are:

image

If I keep scrolling, I encounter NaN:

image

Perhaps I am using the movement incorrectly?

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

No branches or pull requests

3 participants