Focus order is logical and predictable
Why it matters
An illogical focus order — caused by positive tabindex values or CSS positioning that diverges from DOM order — means keyboard users encounter page elements in a sequence that does not match the visual reading order. WCAG 2.2 SC 2.4.3 (Focus Order) is a Level AA requirement. When a user tabs from the footer back to the header before reaching the main content, the interaction model breaks down and tasks become impossible to complete predictably.
Severity rationale
Medium because a scrambled tab order disorients keyboard users and makes task completion unreliable, violating WCAG 2.2 SC 2.4.3 at Level AA — harmful but not a complete access blocker.
Remediation
Rely on natural DOM order for focus sequence. Remove all positive tabindex values and fix any CSS positioning that creates a mismatch between visual and DOM order.
// Bad — positive tabindex overrides DOM order unpredictably
<button tabIndex={2}>Third visually, first in DOM</button>
<button tabIndex={1}>First visually, second in DOM</button>
// Good — DOM order matches visual order, no tabindex needed
<nav>...</nav>
<main>
<h1>...</h1>
<form>...</form>
</main>
<footer>...</footer>
Use tabindex="0" only to add a non-interactive element to the tab order. Use tabindex="-1" to remove an element from natural order (for programmatic focus management). Search for any tabIndex value greater than 0 in your codebase — each is a likely focus order bug.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Accessibility WCAG Compliance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- wcag:2.2 · 2.4.3 — Focus Order
- section-508:2018-refresh · 501.1 — Scope
Taxons
History
- 2026-04-18·v1.0.0·Initial import from accessibility-wcag·automated