-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 enumNames are not applied to null values #2900
Comments
This actually seems to work as expected with the semantic-ui and both material-ui themes (4 and 5). With other themes either the value is given the |
Any updates on this? I also have this problem with |
The issue in the above playground seems to go away if the |
Prerequisites
What theme are you using?
core
Version
4.2.0
Current Behavior
I have a field with number enums, which should be nullable. I've specified the type to be
["number", "null"]
. I'm also usingenumNames
property to give the values different titles. My schema is this:But when I choose the
null
("None") value, the data doesn't give the field valuenull
. Instead it gives it value"None"
. For other values it works, for example if I choose the value"Red"
, the value is0
as it should. I'm seeing this behavior withtype: ["string", "null"]
as well.I've also tried providing the following UISchema with no luck:
Expected Behavior
enumNames
should also map names fornull
values.Steps To Reproduce
type: ["number", "null"]
enum
values. Leave one of themnull
.enumNames
. You could name thenull
value for example"Empty"
.null
value (with the name"Empty"
).null
as expected, but"Empty"
.Environment
Anything else?
Link to the RJSF playground: here
The text was updated successfully, but these errors were encountered: