-
Notifications
You must be signed in to change notification settings - Fork 51
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
NumberController behaves weird when scrolling mousewheel #46
Comments
Hey thanks for pointing this out. Is this happening with a notched mouse wheel, or a continuous scroll, like a trackpad? The purpose of that function is to distinguish between continuous and notched scrolls, and then normalize them. The goal is to make it so that one "notch" (or "line") on the mouse wheel equates to one step. Strangely enough the 120 is actually part of the spec. Unfortunately the wheel event varies in behavior pretty drastically from browser to browser—deltaX, deltaY and wheelDelta will mean very different things. Ultimately I'm not too hopeful about a cross-browser fix for this. The only thing I could think of would be some form of browser detection, but I'm open to suggestions. |
It's a notched mouse wheel, Logitech M720 Triathlon if it matters
Wow, that's really interesting haha
Yeah, that's what I'm thinking too. Unfortunately I've almost zero experience with JS. Maybe leave this open for future volunteers? |
I can confirm this right in the off docs example: |
I can confirm this for number input fields and for sliders too |
Yes thank you @psnet, this is a known issue. I would be curious to know which browser, OS and mouse you're using. The PR above would "normalize" scroll wheel behavior across browsers, but I've been hesitant to merge it, as it would make mouse wheel scrolling much slower for many people. |
I define my
NumberController
like:Keyboard arrow-up and arrow-down work correctly. However, mouse scrolling event increases and decreases the values by 5.3 😕 the same behaviour is experienced with a dofferent controller (the sliders) where keyboards change the value by
0.015
but mouse wheel changes the value by0.0795
(also 5.3 times larger).I noticed these lines when searching for the problem:
lil-gui/src/NumberController.js
Lines 416 to 433 in d3c2bfd
Maybe the magic
120
is wrongly hardcoded? But I can't even grasp my head around what the value would depend on...I use Brave Browser:
Version 1.36.83 Chromium: 98.0.4758.87 (Official Build) beta (64-bit)
The text was updated successfully, but these errors were encountered: