-
Notifications
You must be signed in to change notification settings - Fork 497
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
fix: prevent scroll adjusting number inputs #1280
Conversation
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Branch preview |
How does this compare to the alternative that is suggested in the MUI docs i.e. not using |
onWheel
events
It blurred the input on scroll. The GOV.UK Design System team make a very compelling argument for the proposed implementation. As it's the suggested implementation by MUI as well, I think we should use it. |
One issue I noticed with it is that the validation and pattern is not aligned anymore e.g. inputs like Also, should we use the new field for the Amount input as well? |
As this issue is purely related to scroll prevention, I would suggest we revert to my initial implementation that blurred the input on scroll input and research then this further. What do you think? |
Branch preview✅ Deploy successful! https://scroll-number-inputs--webcore.review-web-core.5afe.dev |
What it solves
Resolves #1234
How this PR fixes it
A new
NumberField
component has been created (isolating the commontype
andautoComplete
attributes). It blurs the fieldonWheel
.A
ref
is used asTextField
doesn't work withcurrentTarget
.How to test it
Ensure the following fields work as expected, with validation and preventing scroll from editing the value: