-
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
Modify JSON Validation for Optgroup support #1813
Comments
@Enola-guy thanks for your custom widget! I don't think we can merge this into the main library, though, until we have a JSON Schema-compliant approach (and in JSON Schema, {
"ui:groups": [
{ "title": "Theropods", "items": ["Tyrannosaurus", "Velociraptor"] },
...
]
} This is just an idea -- let me know if you have any other thoughts / ways of doing this. |
Thanks for the hint, I'm gonna try this, unfortunately it's not going to be DRY, but that's something. Will update the code today. |
Hey late update, thank you so much it worked |
Would you be interested in contributing your widget to this library as a PR? |
I would be very interested ! I just need to know precisely what needs to be done, I'm more of a python dev than a react one. |
@Enola-guy Can you please share your working code here? |
I made a PR implementing this feature: It extends the current SelectWidget to support "selectWidgetOptions3": {
"ui:options": {
"optgroups": {
"lipsum": [
"foo"
],
"dolorem": [
"bar"
]
}
}
} |
Hello, I've successfully created the widget to support optgroup select (i.e. categories inside a select). I'm now seeking help for the validation.
In order to generate the categories I give a dict instead of a list to my "enum" field. How can I modify the JSON validation to avoid the error
.enum should be array
Here is the codepen of my implementation:
https://codepen.io/enola-guy/pen/ZEQOVEN
If you can explain me the steps missing, I would gladly open a PR in order to make this feature in the main branch :)
The text was updated successfully, but these errors were encountered: