-
Notifications
You must be signed in to change notification settings - Fork 129
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> element cannot be forced uncontrolled #329
Comments
Can you explain a bit for your use case of needing an uncontrolled input? |
No particular use case from my side but it's the only controlled input in your library. |
You should be able to use an empty string as the default value. |
|
Will look into it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
I'm creating a demo page where I show the various form elements in a modal card.
All these elements are uncontrolled inputs and it's wanted.
All except
<Select>
where options cannot be changed without making a controlled input.EDIT: doesn't work in multiple mode or not
Looking at the code you are forcing the defaultValue if value isn't specified and the defaultValue cannot be specified.
I think forcing the value isn't good practise because the input will be controlled
react-bulma-components/src/components/form/components/select.js
Lines 28 to 50 in ad9c351
EDIT:
Using value={null} makes the Select uncontrolled but React prints a warning about this:
The text was updated successfully, but these errors were encountered: