Concept 13 of 21· Designing for everyone
  1. 1Accessibility
  2. 2Disability
  3. 3Permanent, temporary and situational disabilities
  4. 4Assistive technology
  5. 5Screen readers
  6. 6Semantic HTML
  7. 7ARIA
  8. 8WCAG
  9. 9The four principles of accessibility (POUR)
  10. 10WCAG conformance levels
  11. 11Keyboard access
  12. 12Focus order
  13. 13Keyboard trap
  14. 14Focus management
  15. 15Skip links
  16. 16Reduced motion
  17. 17Text alternatives
  18. 18Plain language
  19. 19Inclusive design
  20. 20Universal design
  21. 21Accessibility vs inclusive design vs universal design

Share this card

Keyboard trap

When keyboard focus gets stuck inside one part of a page and you can't move away from it using only the keyboard.

Also called no keyboard trap (WCAG 2.1.2)

Example

In a made-up news article, Tab moves into an embedded video player and then just cycles round its buttons, never reaching the rest of the page.

A keyboard trap is when focus gets stuck in one part of a page and you can't move away using only the keyboard. Here, Tab goes into a news article's video player and just cycles round its buttons; once the player is fixed, Tab moves out to the next link.

When to use it

Tab into and back out of every embedded player, map, widget and pop-up. If leaving needs an unusual key, tell people which one. WCAG makes this a Level A requirement, the most basic level.

Watch out

Keeping focus inside an open dialog on purpose is fine, as long as people can leave it with the keyboard, for example by pressing Escape.

The evidence 4 sourced claims

Every sentence on this card traces back to one of these claims, each linked to its source. How we research

  1. WCAG SC 2.1.2 No Keyboard Trap (Level A): if focus can move into a component with the keyboard, it must be possible to move it away using only the keyboard; if that needs more than standard keys, the user is told how.

  2. Keyboard traps often come from content rendered using plug-ins or embedded applications.

  3. Restricting focus to part of the content is acceptable as long as the user knows how to 'untrap' focus and leave that component with the keyboard.

  4. In W3C's modal dialog pattern, Tab wraps within the dialog and Escape closes it.

Last checked 14 Nov 2026

Popular searches

Cookie settings

Choose which optional cookies SimplyUX can use. Your choice is saved in this browser. Privacy policy