fix(checkbox): hide bubble input with native hidden attribute#3972
Open
fayonation wants to merge 1 commit into
Open
fix(checkbox): hide bubble input with native hidden attribute#3972fayonation wants to merge 1 commit into
fayonation wants to merge 1 commit into
Conversation
Replace aria-hidden on the form bubble input with the native hidden attribute and mirror label association from the control button. Fixes Wave "Missing form label" false positives reported in radix-ui#3167. Co-authored-by: Cursor <cursoragent@cursor.com>
🦋 Changeset detectedLatest commit: ddf77c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Summary
aria-hiddenon the Checkbox form bubble<input>with the nativehiddenattributearia-labelandaria-labelledbyfrom the visible control button onto the bubble inputhtmlForscenario reported in Accessibility issue reported by Wave on Checkbox auto-generated input tag #3167Fixes #3167
Problem
Wave flags "Missing form label" on the auto-generated bubble
<input>used for native form integration. The input was hidden witharia-hidden="true"while still being focusable (tabIndex={-1}), which confuses accessibility scanners even when the visible checkbox button is correctly labelled.Solution
Use the native
hiddenattribute instead, which removes the bubble input from the accessibility tree without thearia-hidden+ focusable conflict. Label association is mirrored from the control for scanners that still inspect hidden inputs.Test plan
pnpm vitest run packages/react/checkbox/src/checkbox.test.tsx— 27/27 pass@radix-ui/react-checkboxtypecheck passeshidden: true, form toggle worksMade with Cursor