-
Notifications
You must be signed in to change notification settings - Fork 211
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
[Select] Required in select component not working #610
Comments
Sorry, I was creating a reproduction to share |
It's because you are setting the value to "". It's selecting option1 as a result and not triggered the native required.
For example if you use Why it is selected option1, when "" is passed as value, I'm not sure. |
Cool, you are right. But is weird, that most of the input from radix doesn't allow the value be undefined or null, but the select yes 🥲 |
I'm not too sure why having value={""} would result in "option1" being the active value though. Maybe it's a bug, I'm not too sure. If you think it is, maybe best to have a look at radix/primitives. PS. I'm not a maintainer! |
I'm using the
required
to validate the form using HTML validation. All inputs do a good job, but the select component withrequired = true
lets the form submit even without having an option selected.The text was updated successfully, but these errors were encountered: