Skip to content

Conversation

heath-freenome
Copy link
Member

@heath-freenome heath-freenome commented Oct 13, 2025

Reasons for making this change

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

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature
Screen.Recording.2025-10-12.at.11.23.46.PM.mov

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
@heath-freenome heath-freenome force-pushed the improve-optional-data-controls branch from 280bd2a to 1bc64ef Compare October 13, 2025 06:22
@heath-freenome heath-freenome merged commit 277f397 into rjsf-team:main Oct 13, 2025
4 checks passed
@heath-freenome heath-freenome deleted the improve-optional-data-controls branch October 13, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants