- Success Criterion 3.2.1
- Conformance level A
Keyboard Focus Triggering an Unexpected Scroll Jump
3.2.1 — On Focus
Scenario
Setting
A podcast app's episode list
What’s wrong
Focus triggering scroll-jacking that relocates the user to a different section (context change).
Example
episodeLink.addEventListener('focus', () => {
document.getElementById('now-playing').scrollIntoView();
}); Why it matters
Tabbing to any episode link yanks the whole page down to the Now Playing bar, so a listener browsing episodes loses their place in the list on every tab press.
How to test
Tab to an element and stop: if the page scroll-jacks to a different section automatically, it fails.
How to fix
Remove the focus-triggered scrollIntoView entirely, or only scroll on an explicit user action like clicking "Now Playing". Scroll position changes on focus count as a context change; reserve scrollIntoView for deliberate navigation, not passive tabbing.
Outcome
A listener tabs through the full episode list without the page jumping away from them.
Who is affected
Keyboard users trying to scan a long episode list get repeatedly relocated and can't build a mental map of where they are.
Learn more
- Understanding Understanding document (opens in a new tab)
Related scenarios
- Element That Loses Focus the Instant It’s Reached
- Tabbing Into a Field That Opens a Modal Automatically
- Tabbing to a Menu Item That Auto-Navigates to Its Page
- Selecting an Option That Submits the Form Automatically
- Tabbing Into a Field That Opens a Chat Widget
- Autofocus Chain That Jumps Focus From One Field to Another