Skip to content
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

Enum with select widget does not add a blank option at the top #1296

Closed
3 tasks
abhishekpdubey opened this issue May 23, 2019 · 4 comments
Closed
3 tasks

Enum with select widget does not add a blank option at the top #1296

abhishekpdubey opened this issue May 23, 2019 · 4 comments
Labels

Comments

@abhishekpdubey
Copy link

Prerequisites

I facing an issue with the enums. Here is the playground link

Based on the documentation here - https://react-jsonschema-form.readthedocs.io/en/latest/validation/#the-case-of-empty-strings
when enum is used with select widget, an empty option is added in the dropdown. This is not happening in the playground link I shared above.

Notice that the Status dropdown does not have an empty option in it.
I tried adding ui:emptyValue and ui:placeholder to the UI scheme but even this did not work for me.
Am I missing anything?

Version

Latest version in playground

@epicfaace
Copy link
Member

Related to #1041.

It looks like both ui:emptyValue and ui:placeholder are not working for your example, because the type is a boolean. So this may be a different (but related) bug to #1041.

@epicfaace epicfaace added the bug label May 25, 2019
@abhishekpdubey
Copy link
Author

Boolean is just an example, It happens with string values as well.

@Mitgenosse
Copy link

If you remove the "default": "" from the playground links schema, it adds the empty option/placeholder.

I'm not sure if this is the expected behaviour for the default property.

@stale
Copy link

stale bot commented Apr 15, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please leave a comment if this is still an issue for you. Thank you.

@stale stale bot added the wontfix label Apr 15, 2022
@stale stale bot closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants