-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
core
Version
5.24.x
Current Behavior
I'm currently having an issue after updating my version of react-json-schema.
Before that, I could create a radio element with a list of object in enum, and a default object to initialize.
Example :
"example": {
"title": "Radio with object",
"default": {
"label": "First element",
"value": "one"
},
"enum": [
{
"label": "First element",
"value": "one"
},
{
"label": "Second element",
"value": "two"
},
{
"label": "Third element",
"value": "three"
}
],
"minItems": 1,
"maxItems": 1,
}
Since I've updated to 5.24.x, if the default value is an object, I can't select other option in the rendered Radio Element.
I have to delete the default from jsonSchema to make it works.
Do you have any idea to get a default value with a list of object in enum ?
Or is that a bad practice and this is something you don't allow anymore ?
Expected Behavior
Select other item in rendered view when I've set a default value with an object
Steps To Reproduce
You can test it in :
https://rjsf-team.github.io/react-jsonschema-form/
-> Enumerated Objects
-> just add this in properties -> locationRadio
"default": { "name": "New York", "lat": 40, "lon": 74 }
And try to select Amsterdam on the rendered part.
You can't
Environment
- OS: Ubuntu
- Node: 22
- npm:
Anything else?
(can't select Amsterdam on right part after adding a default value)