Skip to content

Commit 277f397

Browse files
Feature - Improve anyOf/oneOf rendering for optional data controls (rjsf-team#4804)
* Feature - Improve anyOf/oneOf rendering for optional data controls Improved the `anyOf`/`oneOf` rendering for optional data controls - In `@rjsf/core`, updated the `SchemaField` to optimize the `anyOf`/`oneOf` rendering along with hiding the label when there is no form data - In `snapshots`, updated `formTests.tsx` a new `optionalArrayWithAnyofs` property to the schema along with removing the `uiSchema` override for `optionalObjectWithOneofs` - Updated the snapshots in all of the themes accordingly - In `playground`, made the same changes as in the `formTests.tsx` for the `optionalDataControls.ts` sample, moving the `experimental_defaultFormStateBehavior` into `liveSettings` - Updated the `Sample` and `LiveSettings` types to support the `liveSettings` inside of a sample - Updated the `Playground`'s `onSampleSelected` callback to merge any `liveSettings` in the sample on top of those already used in the playground - Updated the `CHANGELOG.md` accordingly * - Responded to reviewer feedback
1 parent 174a188 commit 277f397

File tree

19 files changed

+19610
-18810
lines changed

19 files changed

+19610
-18810
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
1515
should change the heading of the (upcoming) version to include a major version bump.
1616
1717
-->
18+
# 6.0.0-beta.22
19+
20+
## @rjsf/core
21+
22+
- Updated `MultiSchemaField` and `SchemaField` to properly display `anyOf`/`oneOf` optional data fields by hiding the label and selector control when it is an optional field AND there is no form data
23+
24+
## Dev / docs / playground
25+
- Updated the `formTests.tsx` snapshots to add an `anyOf` of all arrays with different item types and removed the disabling of the optional data controls feature for the optional object with oneOfs
26+
- Updated the snapshots in all of the themes accordingly
27+
- Updated the playground to make the same changes as `formTests.tsx` in the `optionalDataControls.ts` sample, moving the `experimental_defaultFormStateBehavior` inside of a `liveSettings` block
28+
- Updated the `Sample` and `LiveSettings` types to support the `liveSettings` inside of a sample
29+
- Updated the `Playground`'s `onSampleSelected` callback to merge any `liveSettings` in the sample on top of those already used in the playground
30+
1831
# 6.0.0-beta.21
1932

2033
## @rjsf/antd

packages/antd/test/__snapshots__/Form.test.tsx.snap

Lines changed: 1492 additions & 848 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)