Level AWCAG 2.2

2.1.2 No Keyboard Trap

Keyboard focus can be moved away from any component using only a keyboard.


Why it matters

Inoperable
When focus is trapped, the rest of the page becomes inaccessible.
Keyboard users
Users who cannot use a mouse have no way to escape the trap.
Frustration
Users are forced to reload the page and may lose any data they have entered.
Modals and widgets
Rich UI components can unintentionally trap focus. Make sure they can be dismissed with Esc.

Live demo

Keyboard trap demo

Tab Use the Tab key to move through the form.

You cannot escape the textarea with Tab

Understanding through personas

Nakamura (45) — Repetitive strain injury (RSI)

Prolonged mouse use is difficult, so I work primarily with the keyboard. I got stuck in a rich text editor with no way out and had to force-quit the browser. A long email I was writing was lost.

Checkpoints

References