Skip to content

Custom ui:widget for array #201

@BBB

Description

@BBB

Description

I'm trying to set a custom widget for a property (ingredient_id) of an object in an array (ingredients). I'm unsure if this is possible, as I can't find an example in the docs/ tests.

Steps to Reproduce

{ "type": "object", "properties": { "id": { "type": "string" }, "ingredients": { "title": "Ingredients", "type": "array", "uniqueItems": true, "minItems": 1, "items": { "type": "object", "properties": { "ingredient_id": { "title": "Ingredient", "type": "string" }, }, "additionalProperties": false, "required": [ "ingredient_id", ] } } }, "additionalProperties": false, "required": [ "ingredients" ] }

I've tried:

 { ingredients: { ingredient_id: { 'ui:widget': (props) => <div>CUSTOM</div>, } } }

and

 { ingredients: [{ ingredient_id: { 'ui:widget': (props) => <div>CUSTOM</div>, } }] }

Version

^0.30.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions