- Success Criterion 2.4.7
- Conformance level AA
- W3C reference F55
Element Losing Keyboard Focus the Instant It’s Reached
2.4.7 — Focus Visible
Scenario
Setting
A video streaming service's show detail page
What’s wrong
As soon as an element receives keyboard focus, a script throws focus away (blur) — keyboard users can never actually reach or use it.
Example
Here's a real case from a video streaming service's show detail page: as soon as an element receives keyboard focus, a script throws focus away (blur) — keyboard users can never actually reach or use it.
Why it matters
Sighted keyboard users and low-vision users who must see where focus is. In this case (a video streaming service's show detail page), they can't complete the task using a keyboard alone.
How to test
Tab to an element and check if it loses focus immediately (blur() firing on focus): if so, no indicator has a chance to display and it fails.
How to fix
Never call blur() on focus — let elements keep focus until the user moves it.
Outcome
Once corrected, a video streaming service's show detail page lets them keep track of where they are on the page.
Who is affected
Sighted keyboard users and low-vision users who must see where focus is.
Learn more
- Understanding Understanding document (opens in a new tab)
- Technique Related technique (opens in a new tab)
Related scenarios
- 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
- Focus Indicator Hidden Behind an Overlapping Sticky Element