WCAG 2.1.2: No Keyboard Trap

WCAG 2.1.2 No Keyboard Trap is a level A success criterion from WCAG 2.0. Keyboard focus must not get stuck. If a widget keeps focus, the person needs a documented way to leave it.

A trapped shopper cannot reach the rest of the page or the browser controls.

How to test

Tab into dialogs, chat widgets and embedded players. You should be able to tab back out or press Escape.

How to fix

Close dialogs on Escape and return focus to the button that opened them.

Example that fails

A newsletter modal traps Tab and has no close control.

Example that passes the check

Escape closes the modal and focus returns to the opener.

Shopify

Age-gate and popup apps must close on Escape. Remove any app that does not.

WooCommerce

Test popup plugins. Keep only ones that release focus.

WordPress

Dialog blocks should restore focus on close.

Wix

Lightbox settings should allow closing with Escape.

Related fixes