Skip to content

Conversation

@Suyog241005
Copy link
Contributor

Reasons for making this change

This PR fixes issue #4742, where checkbox widgets rendered duplicate labels or descriptions across multiple themes (such as AntD, Chakra UI, MUI, and others).
The duplication occurred because both the FieldTemplate and the CheckboxWidget components were responsible for rendering labels and descriptions.

This change ensures that checkbox widgets render their description only once and that FieldTemplate skips redundant rendering for checkbox types.
It improves consistency across themes and avoids confusing duplicate text for users.

Fixes #4742

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

@Suyog241005
Copy link
Contributor Author

Hi @heath-freenome ,
I’ve opened this PR to fix the duplicated description and label rendering in checkbox widgets across all themes.
I’ve verified the fix in the playground and updated the changelog accordingly.
Please review when you have a chance.
Thanks!

onFocus={handleFocus}
error={rawErrors && rawErrors.length > 0 ? rawErrors.join('\n') : undefined}
aria-describedby={ariaDescribedByIds(id)}
{...themeProps}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this fix the issue with mantine?

@heath-freenome
Copy link
Member

heath-freenome commented Oct 31, 2025

@Suyog241005 Your tests are failing... Make sure to run the following commands on your branch:

npm install
npm run build
npm run test:update

@Suyog241005
Copy link
Contributor Author

Suyog241005 commented Oct 31, 2025

Hi @heath-freenome ,
I’ve run the following on my local branch:

npm install
npm run build
npm run test:update

All tests are passing on my end.

image

It’s possible that the CI cache or environment mismatch is causing the failure.
Could you please re-run the CI jobs to confirm?

CHANGELOG.md Outdated
should change the heading of the (upcoming) version to include a major version bump.
-->
# 6.0.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 6.0.0
# 6.0.2

Copy link
Member

@heath-freenome heath-freenome Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need you to move all of these changes in the CHANGELOG.md under the 6.0.2 section ABOVE the 6.0.1 section... With only your additions to the sections you have right now. and order the themes alphabetically

@heath-freenome
Copy link
Member

heath-freenome commented Oct 31, 2025

@Suyog241005 you'll need to rebase anyway, which will cause your tests to run again... After the rebase do again what I suggested, since the package.json changed recently. You may generate new snapshots.

@Suyog241005 Suyog241005 force-pushed the fix/4742-checkbox-label-duplication branch from a5eedb7 to 0581174 Compare November 1, 2025 02:57
@Suyog241005
Copy link
Contributor Author

@heath-freenome I’ve rebased, resolved conflicts, and all required checks have passed. Please review it when you get the chance.

@heath-freenome
Copy link
Member

@heath-freenome I’ve rebased, resolved conflicts, and all required checks have passed. Please review it when you get the chance.

Can you address the feedback I've left as well. Especially the CHANGELOG.md

@Suyog241005 Suyog241005 force-pushed the fix/4742-checkbox-label-duplication branch from 0581174 to 3bb4c67 Compare November 1, 2025 05:54
@Suyog241005
Copy link
Contributor Author

@heath-freenome , I have updated CHANGELOG.md — moved all entries under the 6.0.2 section above 6.0.1 as requested.

Suyog241005 and others added 2 commits November 1, 2025 16:07
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
@heath-freenome
Copy link
Member

heath-freenome commented Nov 1, 2025

@Suyog241005 one last thing, can you update the formTests.tsx in the snapshot-tests package to add tests with a checkbox having description. You can use the same schema/uiSchema you highlighted in your screen capture. Also, add tests with the same schema, with the uiSchema having radio and then select widgets. That way we can verify the fix continues to work in the future

@Suyog241005
Copy link
Contributor Author

Hi @heath-freenome , I have added the requested snapshot tests for checkbox with description, radio, and select widgets in formTests.tsx.
Please review when you get a chance and let me know if anything else needs adjustment.

@heath-freenome
Copy link
Member

@Suyog241005 One small set of changes to the tests, a rebase and then I will approve/merge

Suyog241005 and others added 4 commits November 2, 2025 09:45
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
@Suyog241005
Copy link
Contributor Author

@heath-freenome I've made the requested test changes, updated all snapshots, and I've also done a git rebase to ensure everything is in sync. The PR is ready for your review.

dependabot bot and others added 5 commits November 2, 2025 10:44
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [mocha](https://github.com/mochajs/mocha) from 10.8.2 to 11.7.4.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md)
- [Commits](mochajs/mocha@v10.8.2...v11.7.4)

---
updated-dependencies:
- dependency-name: mocha
  dependency-version: 11.7.4
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
@Suyog241005 Suyog241005 force-pushed the fix/4742-checkbox-label-duplication branch from 0a422ea to 6f243ee Compare November 2, 2025 05:16
@heath-freenome heath-freenome merged commit 61860ad into rjsf-team:main Nov 2, 2025
4 checks passed
@Suyog241005 Suyog241005 deleted the fix/4742-checkbox-label-duplication branch November 2, 2025 09:04
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.

Duplicated description when using ui:widget

2 participants