Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ export default class Form<
>
{showErrorList === 'top' && this.renderErrors(registry)}
<_SchemaField
name={idPrefix}
name=''
schema={schema}
uiSchema={uiSchema}
errorSchema={errorSchema}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/components/fields/ObjectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ class ObjectField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends Fo
onDropPropertyClick = (key: string) => {
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, []);
};
};

Expand Down Expand Up @@ -187,7 +187,7 @@ class ObjectField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends Fo
if (!(schema.additionalProperties || schema.patternProperties)) {
return;
}
const { formData, name, onChange, registry } = this.props;
const { formData, onChange, registry } = this.props;
const newFormData = { ...formData } as T;
const newKey = this.getAvailableKey('newKey', newFormData);
if (schema.patternProperties) {
Expand Down Expand Up @@ -220,7 +220,7 @@ class ObjectField<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends Fo
}

// add will pass the name in `path` array
onChange(newFormData, [name]);
onChange(newFormData, []);
};

/** Renders the `ObjectField` from the given props
Expand Down