Repository navigation
fix(a11y): show a focus ring on Checkbox, Switch and RadioGroup - #1291
Merged
Merged
Conversation
FormRoot resets outline on every descendant, and none of these controls defined a focus-visible style, so keyboard focus was invisible on all three. Add the same 2px focus ring BaseButton and IconButton use.
🦋 Changeset detectedLatest commit: 2ca055f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
DreaminDani
approved these changes
Nov 5, 2026
This was referenced Nov 5, 2026
2 of 8 tasks
Contributor
Chromatic Storybook
Built from commit: Statuses as of the end of the run. The build link shows the live review state. |
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.
Description
.form-root * { outline: none; box-shadow: none; }and none of these three define a:focus-visiblestyle, RadioGroup also setsoutline: noneon.radio-inputitself, so the browser ring gets removed and nothing replaces it:focus-visiblerule to.checkinput,.switchand.radio-inputwith the same 2px ring BaseButton and IconButton use (--click-global-color-outline-default, 2px offset), the class plus pseudo class beats the FormRoot reset without touching FormRootLinks and tickets
None, I didn't find an existing issue. Same approach as #894 which added focus outlines to the buttons and triggers
Good to know
Checklist
Contribution
buildandbuild-storybookwork locallyAccessibility
Checked with Tab and Shift+Tab on the Checkbox, Switch and RadioGroup default stories in light and dark, the ring now shows on all three and uses the same token as BaseButton, IconButton and the Select trigger. That covers WCAG 2.4.7 Focus Visible. I didn't test with a screen reader since names and roles don't change here, and I didn't check target size, the checkbox and radio are still 16px
aria-labelScreenshots
Focused with the Tab key, before and after, light and dark
Note
Low Risk
CSS-only focus styling on three form controls; no logic, API, or FormRoot behavior changes.
Overview
Adds keyboard focus-visible outlines to Checkbox, Switch, and RadioGroup so Tab focus is visible again inside forms. FormRoot clears outlines on descendants and these controls had no replacement ring (RadioGroup also set
outline: noneon the input).Each control now gets the same 2px token ring (
--click-global-color-outline-default, 2px offset) as Button / IconButton, without changing FormRoot. A patch changeset records the visual a11y fix.Reviewed by Cursor Bugbot for commit 2ca055f. Bugbot is set up for automated code reviews on this repo. Configure here.