custom widget for array fields with no `enums` or `uniqueItems` set to true
See original GitHub issuePrerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I’m providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
Why is it not possible to specify a custom widget for array fields with no enums
or uniqueItems
set to true? I would like to create 2 widgets:
- A multiSelect with the possibility to add new entries (no
enum
). - A multiSelect with the possibility to select an entry multiple times (
uniqueItems = false
).
Steps to Reproduce
- Having an array without
enum
oruniqueItems
in itsitems
.
const schema = {
type: "array",
items: {
"type": "string"
},
};
const uiSchema = {
"ui:widget": "myCustomWidget"
}
Expected behavior
Widget myCustomWidget
to be used.
Actual behavior
Widget used is the default rendered by this.renderNormalArray()
Version
v1.7.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Form customization - react-jsonschema-form documentation
Typically this applies when a schema has an enum list for the items property of an array field, and the uniqueItems property set...
Read more >react-jsonschema-materialui-forms
Typically this applies when a schema has an enum list for the items property of an array field, and the uniqueItems property set...
Read more >Extend the Kubernetes API with CustomResourceDefinitions
This page shows how to install a custom resource into the Kubernetes API by creating a ... The field uniqueItems cannot be set...
Read more >Array
Schema type for arrays of other types. ... If set to true , this field will not be editable in the content studio....
Read more >Advanced Form
Note: When using enum fields be sure to select the appropriate ui:widget in the uischema . enumNames. Custom labels used to provide readable...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks – do you mind adding it to the weekly meeting agenda? I think a synchronous review would be easiest – https://github.com/rjsf-team/react-jsonschema-form/issues/2677
@epicfaace - Not a huge fan of the approach on https://github.com/rjsf-team/react-jsonschema-form/pull/2125 so created https://github.com/rjsf-team/react-jsonschema-form/pull/2697. Would you mind taking a look?