diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a7027bbb..a57446511d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ should change the heading of the (upcoming) version to include a major version b --> # 6.0.0-beta.15 +## @rjsf/core + +- Updated `ArrayField` `onSelectChange` to not pass `name` in the `path` since the `ObjectField` will automatically add it [#4733](https://github.com/rjsf-team/react-jsonschema-form/issues/4733) + ## @rjsf/semantic-ui - Updated `ArrayField` to stop using `nanoid` and instead use `lodash/uniqueId` to fix [#4762](https://github.com/rjsf-team/react-jsonschema-form/issues/4726) diff --git a/packages/core/src/components/fields/ArrayField.tsx b/packages/core/src/components/fields/ArrayField.tsx index 0427888eda..ff6bea1d35 100644 --- a/packages/core/src/components/fields/ArrayField.tsx +++ b/packages/core/src/components/fields/ArrayField.tsx @@ -418,9 +418,9 @@ class ArrayField { - const { name, onChange, idSchema } = this.props; - // select change will pass the `path` array with the name - onChange(value, [name], undefined, idSchema && idSchema.$id); + const { onChange, idSchema } = this.props; + // select change will pass an empty `path` array since the `ObjectField` will add the path value automatically + onChange(value, [], undefined, idSchema && idSchema.$id); }; /** Helper method to compute item UI schema for both normal and fixed arrays