-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Cannot unselect a SelectField that is optional #119
Comments
I think, that change from: <option value="" disabled hidden> to <option value="" disabled={required} hidden={required}> would be enough. And now, there's a question - will it break anything? |
Also changing to an Any thoughts, @todda00? |
I just changed the behaviour to
It worked as expected, I was able to add items to the array, the optional ones can be added, then if removed later, they are removed from the model. The required ones are indeed required. There is some additional consideration required for when no placeholder is present, it should still have a null option to select. I can make a PR for BS4 and have you take a look, and if it looks good I will include BS3. I can do the other 2 as well, I have no semantic experience, but its probably a minor change. |
It looks great, @todda00! |
Expected behavior: When a field in the schema is optional, the SelectField will have an option to de-select the selection.
Placeholder works only until the user clicks on the select box, then they are presented with all the options, but no way to remove their selection.
Example schema:
Example SelectField:
HTML Output (nothing selected yet):
Initial click into dropdown:
HTML Code:
It seems the disabled and hidden need to be removed from the placeholder, although I would think this would have more implications in other use cases. I found #78 referencing the same issue as well.
The text was updated successfully, but these errors were encountered: