Repository navigation
fix: radio group labels and id fixes - #20
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves RadioGroup accessibility by correctly associating group labels with the radiogroup element and adjusting the React implementation to avoid invalid label for/htmlFor behavior.
Changes:
- Vue: adds a stable label
idand wires it to the radiogroup viaaria-labelledby. - React: removes Headless UI
Fieldusage and uses a passiveLabelwithinRadioGroupto ensure proper radiogroup labeling without emittingfor/htmlFor. - React tests: adds assertions for unique radio IDs and correct label association.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/vue/src/components/RadioGroup.vue | Adds label id and aria-labelledby on the radiogroup for proper accessible naming. |
| packages/react/src/components/radio-group.tsx | Refactors label rendering to avoid invalid for binding and improve radiogroup label association. |
| packages/react/src/components/tests/a11y.test.tsx | Adds a11y-focused regression tests for radiogroup labeling and unique radio IDs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+166
to
+169
| const labelId = group.getAttribute("aria-labelledby"); | ||
| expect(labelId).toBeTruthy(); | ||
|
|
||
| const labelEl = container.querySelector(`#${labelId}`)!; |
libretexts-bot
added a commit
that referenced
this pull request
Jun 22, 2026
## [1.10.2](v1.10.1...v1.10.2) (2026-06-22) ### Bug Fixes * radio group labels and id fixes ([#20](#20)) ([e2b9eac](e2b9eac))
Collaborator
|
🎉 This PR is included in version 1.10.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.