- Success Criterion 2.4.7
- Conformance level AA
Focus-Visible Polyfill Misconfigured to Show Nothing at All
2.4.7 — Focus Visible
Scenario
Setting
A fitness app's workout tracker
What’s wrong
Component libraries with:focus-visible (keyboard-focus styling) polyfill misconfigured so keyboard focus matches mouse and shows nothing.
Example
.js-focus-visible :focus:not(.focus-visible) {
outline: none;
}
.focus-visible {
outline: none;
} Why it matters
Because of the inverted rule, keyboard focus on the Start Workout button never gets an outline, while the polyfill logic works correctly everywhere else.
How to test
Tab through components built with a:focus-visible polyfill: check whether keyboard focus and mouse click are being treated identically (showing nothing) due to misconfiguration.
How to fix
When adopting a focus-visible polyfill, verify the visible style is attached to the class it actually applies on keyboard use.
.js-focus-visible :focus:not(.focus-visible) {
outline: none;
}
.focus-visible {
outline: 2px solid #ff6b35;
} Outcome
A user tabs to Start Workout and sees a clear orange outline confirming it's focused.
Who is affected
Keyboard users lose focus visibility across every component using the library, even though it's designed to support it.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Element Losing Keyboard Focus the Instant It’s Reached
- Focus Outline Removed by CSS With No Replacement
- Global CSS Reset Removing Every Focus Outline Site-Wide
- Focus Indicator Styled for Some Components but Not Others
- Focus Indicator That’s Just a Subtle, Hard-to-See Color Shift
- Focus Style That Only Appears on Hover, Never on Tab Focus