diff --git a/CHANGELOG.md b/CHANGELOG.md index fbad7c19e2..20ab6f430a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,9 +17,14 @@ should change the heading of the (upcoming) version to include a major version b --> # 6.0.0-beta.17 +## @rjsf/core + +- Updated `ObjectField` to remove the `name` from the path passed to `onChange()` callback in `handleAddClick()` and `onDropPropertyClick()`, fixing [#4763](https://github.com/rjsf-team/react-jsonschema-form/issues/4763) +- Updated `Form` to restore the passing of an empty string for `name` to avoid accidentally showing it as the title for the whole schema + ## @rjsf/shadcn -- Update ArrayFieldItemTemplate to align buttons with the input field [#4753](https://github.com/rjsf-team/react-jsonschema-form/pull/4753) +- Update `ArrayFieldItemTemplate` to align buttons with the input field, fixing [#4753](https://github.com/rjsf-team/react-jsonschema-form/pull/4753) # 6.0.0-beta.16 diff --git a/packages/core/src/components/Form.tsx b/packages/core/src/components/Form.tsx index f56b973011..85ed258503 100644 --- a/packages/core/src/components/Form.tsx +++ b/packages/core/src/components/Form.tsx @@ -1153,7 +1153,7 @@ export default class Form< > {showErrorList === 'top' && this.renderErrors(registry)} <_SchemaField - name={idPrefix} + name='' schema={schema} uiSchema={uiSchema} errorSchema={errorSchema} diff --git a/packages/core/src/components/fields/ObjectField.tsx b/packages/core/src/components/fields/ObjectField.tsx index d054571e33..4cd61d4133 100644 --- a/packages/core/src/components/fields/ObjectField.tsx +++ b/packages/core/src/components/fields/ObjectField.tsx @@ -94,11 +94,11 @@ class ObjectField { return (event: DragEvent) => { event.preventDefault(); - const { onChange, formData, name } = this.props; + const { onChange, formData } = this.props; const copiedFormData = { ...formData } as T; unset(copiedFormData, key); // drop property will pass the name in `path` array - onChange(copiedFormData, [name]); + onChange(copiedFormData, []); }; }; @@ -187,7 +187,7 @@ class ObjectField