react-jsonschema-form icon indicating copy to clipboard operation
react-jsonschema-form copied to clipboard

access sibling data in uiSchema

Open graingert opened this issue 6 years ago • 1 comments

Prerequisites

  • [x] 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.

Description

I've got a select box and an auto-complete widget, I'd like to be able to filter what's in the autocomplete-widget based on the contents of the select box

graingert avatar Jul 03 '18 16:07 graingert

const schema = {
  type: 'object',
  properties: {
    type: {
        type: 'string',
        enum: ['ham', 'spam', 'eggs'],
    },
    fk: {
        type: 'integer'
    },
  },
};

const uiSchema = {
  {
  'ui:widget': 'autocomplete',
  'ui:options': { type: '$.type' }, // you could put the path to the formValue
}

graingert avatar Jul 03 '18 16:07 graingert