-
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
Name prop in custom widget for nested properties #1763
Labels
Comments
This was referenced May 19, 2020
@Parro can you workaround this by using a custom ObjectField or custom ObjectFieldTemplate? |
Hi @newt10, I could use a custom |
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 4, 2023
Fixes rjsf-team#1763 by adding `name` to `WidgetProps` and ensuring it is passed to all widgets from field implementations - Updated `@rjsf/utils` to add `name` to the `WidgetProps` type and updated the documentation of `id` to better reflect it being used for `name` and `id` on HTML field elements - Updated `@rjsf/bootstrap-4` mock creation to provide a `name` on the base `WidgetProps` - Updated `@rjsf/core` to update `ArrayField`, `BooleanField`, `MultiSchemaField`, `StringField` and `AltDateWidget` to pass the `name` field through to the widgets rendered - Updated `BaseInputTemplate` to extract the `name` prop from the rest of the props spread onto the `input` to keep using the `id` as the `name` - Updated `@rjsf/material-ui` and `@rjsf/mui` to extract the `name` prop from the rest of the props spread onto the `TextField` field in `BaseInputTemplate` and `SelectWidget` - Updated the `custom-widgets-fields` documentation to add the `name` prop for widgets and to update the `id` documentation - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 4, 2023
Fixes rjsf-team#1763 by adding `name` to `WidgetProps` and ensuring it is passed to all widgets from field implementations - Updated `@rjsf/utils` to add `name` to the `WidgetProps` type and updated the documentation of `id` to better reflect it being used for `name` and `id` on HTML field elements - Updated `@rjsf/bootstrap-4` mock creation to provide a `name` on the base `WidgetProps` - Updated `@rjsf/core` to update `ArrayField`, `BooleanField`, `MultiSchemaField`, `StringField` and `AltDateWidget` to pass the `name` field through to the widgets rendered - Updated `BaseInputTemplate` to extract the `name` prop from the rest of the props spread onto the `input` to keep using the `id` as the `name` - Updated `@rjsf/material-ui` and `@rjsf/mui` to extract the `name` prop from the rest of the props spread onto the `TextField` field in `BaseInputTemplate` and `SelectWidget` - Updated the `custom-widgets-fields` documentation to add the `name` prop for widgets and to update the `id` documentation - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 4, 2023
Fixes rjsf-team#1763 by adding `name` to `WidgetProps` and ensuring it is passed to all widgets from field implementations - Updated `@rjsf/utils` to add `name` to the `WidgetProps` type and updated the documentation of `id` to better reflect it being used for `name` and `id` on HTML field elements - Updated `@rjsf/bootstrap-4` mock creation to provide a `name` on the base `WidgetProps` - Updated `@rjsf/core` to update `ArrayField`, `BooleanField`, `MultiSchemaField`, `StringField` and `AltDateWidget` to pass the `name` field through to the widgets rendered - Updated `BaseInputTemplate` to extract the `name` prop from the rest of the props spread onto the `input` to keep using the `id` as the `name` - Updated `@rjsf/material-ui` and `@rjsf/mui` to extract the `name` prop from the rest of the props spread onto the `TextField` field in `BaseInputTemplate` and `SelectWidget` - Updated the `custom-widgets-fields` documentation to add the `name` prop for widgets and to update the `id` documentation - Updated the `CHANGELOG.md` file accordingly
8 tasks
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Mar 5, 2023
Fixes rjsf-team#1763 by adding `name` to `WidgetProps` and ensuring it is passed to all widgets from field implementations - Updated `@rjsf/utils` to add `name` to the `WidgetProps` type and updated the documentation of `id` to better reflect it being used for `name` and `id` on HTML field elements - Updated `@rjsf/bootstrap-4` mock creation to provide a `name` on the base `WidgetProps` - Updated `@rjsf/core` to update `ArrayField`, `BooleanField`, `MultiSchemaField`, `StringField` and `AltDateWidget` to pass the `name` field through to the widgets rendered - Updated `BaseInputTemplate` to extract the `name` prop from the rest of the props spread onto the `input` to keep using the `id` as the `name` - Updated `@rjsf/material-ui` and `@rjsf/mui` to extract the `name` prop from the rest of the props spread onto the `TextField` field in `BaseInputTemplate` and `SelectWidget` - Updated the `custom-widgets-fields` documentation to add the `name` prop for widgets and to update the `id` documentation - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
that referenced
this issue
Mar 6, 2023
Fixes #1763 by adding `name` to `WidgetProps` and ensuring it is passed to all widgets from field implementations - Updated `@rjsf/utils` to add `name` to the `WidgetProps` type and updated the documentation of `id` to better reflect it being used for `name` and `id` on HTML field elements - Updated `@rjsf/bootstrap-4` mock creation to provide a `name` on the base `WidgetProps` - Updated `@rjsf/core` to update `ArrayField`, `BooleanField`, `MultiSchemaField`, `StringField` and `AltDateWidget` to pass the `name` field through to the widgets rendered - Updated `BaseInputTemplate` to extract the `name` prop from the rest of the props spread onto the `input` to keep using the `id` as the `name` - Updated `@rjsf/material-ui` and `@rjsf/mui` to extract the `name` prop from the rest of the props spread onto the `TextField` field in `BaseInputTemplate` and `SelectWidget` - Updated the `custom-widgets-fields` documentation to add the `name` prop for widgets and to update the `id` documentation - Updated the `CHANGELOG.md` file accordingly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Description
If the schema is an object of fields, in the custom Field component there is a
name
prop (I didn't found it in the doc) that contains the schema property name, while theid
prop containsas stated in the docs.
In the custom Widget component, I found only
id
as a string and noname
prop, see Codepen https://codepen.io/Parro78/pen/zYvMZVY.name
is useful because it is the same name used in the formData object. Could we uniform the behavior adding name in both Field and Widget component?Expected behavior
If a field is a child of an object field,
name
is exposed in the props in the Field and Widget components.Actual behavior
If a field is a child of an object field,
name
is present only in Field component and undocumentedVersion
2.0.1
I made a PR to add the name prop.
The text was updated successfully, but these errors were encountered: