You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Reworked the additional properties remove code (#4852)
Fixes: #4850 by moving the deleting of an additional property from `ObjectField` to `Form`
- In `@rjsf/utils` added a special `ADDITIONAL_PROPERTY_KEY_REMOVE` symbol to `constants.ts`
- In `@rjsf/core`:
- Updated `ObjectField`'s `handleRemoveProperty()` to call `onChange()` with `ADDITIONAL_PROPERTY_KEY_REMOVE` and the `fieldPathId.path` + `key`
- Made the `key` for the `ObjectFieldProperty` render stable
- Updated `Form`'s `processPendingChange()` to detect when the `newValue` is `ADDITIONAL_PROPERTY_KEY_REMOVE` and remove the data instead.
- Updated the `CHANGELOG.md` accordingly
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ should change the heading of the (upcoming) version to include a major version b
32
32
- Fixed duplicate label and description rendering in `CheckboxWidget` by conditionally rendering them based on widget type
33
33
- Updated `CheckboxWidget` to handle label and description rendering consistently
34
34
- Modified `FieldTemplate` to skip label and description rendering for checkbox widgets, fixing ([#4742](https://github.com/rjsf-team/react-jsonschema-form/issues/4742))
35
+
- Updated `ObjectField` to change the removal of an additional property to defer the work to the `processPendingChange()` handler in `Form`, fixing [#4850](https://github.com/rjsf-team/react-jsonschema-form/issues/4850)
35
36
36
37
## @rjsf/fluentui-rc
37
38
@@ -65,6 +66,7 @@ should change the heading of the (upcoming) version to include a major version b
65
66
## @rjsf/utils
66
67
67
68
- Updated `getDefaultFormState()` to not save an undefined field value into an object when the type is `null` and `excludeObjectChildren` is provided, fixing [#4821](https://github.com/rjsf-team/react-jsonschema-form/issues/4821)
69
+
- Added new `ADDITIONAL_PROPERTY_KEY_REMOVE` constant
0 commit comments