Home / Glossary / What is a keyboard trap?

What is a keyboard trap?

Published 2026-09-14

A keyboard trap is a component that a keyboard user can enter but cannot leave: focus moves in and no key combination moves it back out, stranding anyone navigating without a mouse. WCAG 2.2 AA forbids traps outright. On Shopify, the classic offender is the cart drawer, followed by modals, quick views, and chat widgets.

Why traps are so damaging

A trap is not friction, it is a wall. A shopper who tabs into a cart drawer that never releases focus cannot finish shopping, cannot reach checkout, and cannot even escape without reloading. For plaintiff firms, a recorded trap is the cleanest possible exhibit: total blockage on the purchase path, reproducible on demand.

How traps happen

Drawers and modals need deliberate focus management: move focus in on open, cycle it within while open, close on escape, and return focus to the trigger on close. Themes and apps that skip any of those steps create traps. App-injected widgets are the worst repeat offenders because merchants never tested them by keyboard.

How to find and fix them

The test takes seconds per component: tab in, try to tab or escape out. Automated monitoring performs this check on every interactive component of every template continuously, so a theme update or app install that introduces a trap gets flagged the day it ships, with the responsible component named.

Find out where your store stands

Get a free accessibility audit