question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

custom widget for array fields with no `enums` or `uniqueItems` set to true

See original GitHub issue

Prerequisites

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

  1. Having an array without enum or uniqueItems in its items.
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:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
epicfaacecommented, Feb 10, 2022

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

0reactions
alfonsoarcommented, Feb 9, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found