2.1 Keyboard Accessible · SC 2.1.2

A1 min read

No Keyboard Trap

If keyboard focus can be moved to a component of the page using a keyboard interface, then focus can be moved away from that component using only a keyboard interface, and, if it requires more than unmodified arrow or tab keys or other standard exit methods, the user is advised of the method for moving focus away.

In plain language

If someone can reach a part of the page using only the keyboard, they must also be able to leave it using only the keyboard.

Why it matters

Someone who can't use a mouse relies on the keyboard to move around. If a component traps keyboard focus with no way out, that person is stuck and may not be able to use the rest of the page.

In practice

Fails this criterion

A custom pop-up widget captures all keyboard input and never releases it. Pressing Tab, Escape, or any other key keeps focus locked inside, and nothing explains how to get out.

Meets this criterion

The same widget can be exited with a standard key like Escape or Tab. If it needs a non-standard key combination, the user is told about it beforehand.

Test it yourself

Navigate the whole page using only Tab, Shift+Tab, and the arrow keys. If you ever get stuck inside a component with no way to move focus back out, this criterion is failing.

Read SC 2.1.2 on the official WCAG 2.2 specification ↗