-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[base-ui][useSelect] Support browser autofill #39595
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
Conversation
Netlify deploy previewhttps://deploy-preview-39595--material-ui.netlify.app/ @material-ui/unstyled: parsed: +0.38% , gzip: +0.25% Bundle size reportDetails of bundle changes (Toolpad) |
@michaldudak I'm thinking about the following refactor:
What do you think? What would you name the input's slot if we go that route? |
I'd keep it on the Select. It'll be more in-line with the native HTML select. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and works great! Good job!
Closes #37646
Support browser autofill in the useSelect hook and Select component.
Changes:
onChange
handler togetHiddenInputProps
whichautoComplete
prop to Select component and forward to the hidden inputManual testing
I tested with
I couldn't get Firefox autofill to work on my computer, so I didn't test with that one. Apparently, the feature is blocked by region.
Demo
Before changes: https://codesandbox.io/s/base-ui-select-autofill-demo-benchmark-rz7qff?file=/src/Demo.tsx
After changes: https://codesandbox.io/s/base-ui-select-autofill-demo-nj6ylw?file=/src/Demo.tsx
Screen.Recording.2023-10-24.at.16.38.06.mov