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

onWheel delta doesn't match event.delta? #96

Closed
mpolichette opened this issue Oct 11, 2019 · 6 comments
Closed

onWheel delta doesn't match event.delta? #96

mpolichette opened this issue Oct 11, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@mpolichette
Copy link
Contributor

Hey, I'm using "react-use-gesture": "^6.0.7" and I'm getting a weird behavior with onWheel and a stepped mouse, e.g. one which physically click between steps.

I first noticed, I was not getting any movement if i did a single step of the wheel. Investigating, I defined the following handler: useGesture({ onWheel: console.log }) and got the following event.
Screen Shot 2019-10-11 at 2 37 29 PM

As you can see, the event.deltaY has a value, but the delta from useGesture is 0. This isn't an issue if I scroll more quickly and get multiple events.

I've noticed this also effects my macbook trackpad w/ very small movements, but its harder to trigger a single event, so its less noticeable.

Any thoughts on why the delta doesn't reflect the events or ideas for how I could recognize these small movements?

@dbismut
Copy link
Collaborator

dbismut commented Oct 11, 2019

@mpolichette hm this looks like a bug, thanks for reporting this, I’ll investigate this tomorrow.

@mpolichette
Copy link
Contributor Author

Thanks @dbismut, you're a great maintainer! 👍

@dbismut dbismut added the bug Something isn't working label Oct 12, 2019
@dbismut
Copy link
Collaborator

dbismut commented Oct 12, 2019

@mpolichette thanks, that's good to hear! 6.0.10 is out and should fix this. It's actually a bigger issue than I initially thought, it actually applies to scroll as well and to offset and movement state attributes. I also did some refactoring so hopefully this doesn't break elsewhere!

@abepuentes
Copy link

@dbismut I'm pretty new to this stuff, so sorry if this is not the place to comment this. But I think after this change been applying since 6.0.8, the scroll movement has getting some "jiggle" behavior, because that's kind of difficult to explain, I was testing this example from drcmd (https://codesandbox.io/embed/react-three-fiber-suspense-gltf-loader-l900i ). If you change the version from 6.0.7 to any number above, the behavior change, and is very clear if you click on a seat becuase now the click move the model.

@dbismut
Copy link
Collaborator

dbismut commented Oct 14, 2019

@abepuentes Damn you're right. I though I could solve this in a minor release, but I'll release a cleaner 6.1.0 which might result in some minor breaking changes. Anyway 6.0.11 is released and should the issue with previous.

@abepuentes
Copy link

@dbismut 6.0.11 is working fine, I test it in my website and is ok. You are doing a great job.

@dbismut dbismut closed this as completed Oct 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants