-
Notifications
You must be signed in to change notification settings - Fork 209
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
Step in sp-number-field does not affect scrolling #1531
Comments
@davidkudera thanks for submitting. I'm fairly certain this is due to differences in mouse settings, but I am no able to test (no mouse 🙈 ). Would you be able to visit https://westbrook-numberfield-wheel-step--spectrum-web-components.netlify.app/components/number-field and let me know if this performs more how you would expect in this context? If that's so, hopefully we can have this out in a release next week sometime. Thanks so much! 🙏🏼 |
@Westbrook Howdy, I'm actually looking at this myself now. I was considering adding a shift modifier key to the wheel event, but with this issue in mind, it doesn't really make sense. The action uses the event.deltaY property as a multiplier of the step. And it looks like pixel based values are getting returned which can result in HUGE increments if you naturally scroll a bit aggressively. Would you prefer I take a stab at doing something a bit more naturally in my shift modifier PR as well as apply the shift modifier to it as well? My take on it would be just to do it event based a step at a time, ignoring the delta values form the mouse |
@Westbrook Hello, your example works better for me. Value is updated by But, there is another problem I mentioned here (#1509) - scrolling goes in opposite direction compared to native input. I prepared a new example - https://webcomponents.dev/edit/i9wbtQ3zlhqGQBDZk7oi/src/index.ts Behavior when I use "scroll wheel direction - traditional":
And when I use "scroll wheel direction - inverted":
So no matter the settings I use, the direction is always opposite to native behavior. Maybe I should create a new issue for that? |
@bengfarrell scrolling step wise based on direction vs magnitude make sense to me and is what makes this demo work and in If you wanted to adopt this into #1534 that sounds great. I see that having a clearer path into |
Expected Behaviour
When using scroll wheel within focused
<sp-number-field>
the number should change by the configuredstep
value.Actual Behaviour
It goes always up/down by
100
.Platform and Version
Sample Code that illustrates the problem
Should behave similarly to:
The text was updated successfully, but these errors were encountered: