No Keyboard Trap
No Keyboard Trap means that people using only a keyboard should be able to move focus away from any part of a web page after moving to it, without getting stuck. A keyboard trap occurs when a user can navigate into a component but cannot leave it using the keyboard alone, which blocks people who rely on keyboards or keyboard-emulating assistive technology. Meeting this requirement is one part of making content usable without a mouse.
No Keyboard Trap is WCAG Success Criterion 2.1.2, a Level A criterion under the Keyboard Accessible guideline. It requires that if keyboard focus can be moved to a component of the page using a keyboard interface, then focus can also be moved away from that component using only a keyboard interface; and if moving focus away requires more than unmodified arrow or tab keys or other standard exit methods, the user must be advised of the method for doing so. The criterion appears in WCAG 2.0 and is carried forward in later versions (2.1 and 2.2). Common failure cases include modal dialogs, embedded plug-ins, or custom widgets that capture focus without providing a keyboard-operable way out. This criterion should be verified through manual keyboard testing and testing with assistive technology, as automated tools detect only a portion of keyboard-related issues; conformance with this criterion alone does not guarantee overall accessibility or legal compliance. This entry is informational and not legal advice.
Why it matters
Many people navigate the web without a mouse. This includes people with motor disabilities who use only a keyboard, people who rely on assistive technologies such as screen readers that emulate keyboard input, and people using alternative input devices that map to keyboard commands. When a component captures keyboard focus and provides no keyboard-operable way to leave it, these users can become stuck, unable to reach the rest of the page. In practical terms, a keyboard trap can render an entire page or task unusable for someone who cannot use a pointing device, even if every other part of the site is well built.
Keyboard traps commonly appear in modal dialogs, embedded plug-ins, and custom widgets that manage focus without giving users a standard way out. Because a single trapped component can halt progress entirely, this failure has an outsized impact relative to how contained it may look during casual review. WCAG treats No Keyboard Trap as a Level A criterion, the most basic conformance level, which reflects how fundamental keyboard operability is to overall accessibility.
Addressing keyboard traps is one part of making content usable without a mouse, but meeting this criterion alone does not guarantee an accessible experience or legal compliance. It should be considered alongside the broader set of keyboard and assistive technology requirements. This entry is informational and not legal advice; organizations with compliance questions should consult qualified legal counsel and current agency guidance.
Who it's relevant to
Inside No Keyboard Trap
Common questions
Answers to the questions practitioners most commonly ask about No Keyboard Trap.