All WCAG criteria
WCAG 2.1.2 · OperableLevel A
2.1.2No Keyboard Trap
Keyboard focus must be able to move away from any component using only the keyboard — no traps.
Common failures
Patterns that fail this criterion.
- 01Modal dialogs that trap focus and do not return it on close
- 02Embedded third-party widgets (chatbots, video players) that trap focus inside
- 03Custom autocomplete that won't let Tab pass through
How to test
Testing approach: manual.
Manual — Tab through every component on the page; confirm you can always Tab/Shift-Tab out.
How to fix
Remediation steps.
- 1
Modals need a focus manager
On open: trap focus inside. On close: return focus to the trigger element. Use a library (react-aria, headlessui, focus-trap) — these are hard to get right.
- 2
Test third-party embeds
Chatbots and embeds often trap focus. Wrap them in a container that lets users Escape out.
Scan for WCAG 2.1.2 on your site
Find every violation in 42 seconds.
AccessProof runs axe-core 4.9.1 against your site and flags every WCAG criterion with the offending element selector. WCAG 2.1.2 is one of 49 criteria we check on every scan.
All 50 WCAG 2.1 Level A + AA success criteria explained.
View the full checklist