Reviewed November 6, 2026

Keyboard Traps in Shopify Menus: The Escape Key Test

A keyboard trap is the moment a shopper tabs into your menu and cannot tab out. The focus cycles inside the menu forever, or lands somewhere with no visible indicator, and the only escape is a mouse. WCAG 2.1.2, No Keyboard Trap, is Level A, which makes it the most basic failure a storefront can ship.

Level A means the criterion is the floor, not the aspiration. A trap does not block some users partially. It blocks keyboard and switch users completely, on the exact pages where they are trying to buy something. The test for it takes ten minutes and a keyboard, and most stores have never run it.

Where traps hide on Shopify stores

Mega menus are the first place to look. A menu that opens on hover and traps focus inside it, with no Escape key and no way to tab past it, is the most common trap on Shopify storefronts. Quick-view dialogs are the second: the dialog opens, focus goes in, and closing it never returns focus to the button that opened it, so the shopper is stranded. Mobile drawers, date pickers, and size selectors round out the list, each one a small overlay with its own focus behavior.

The pattern is the same in all of them. Something opens, focus goes in, and nobody wrote the code that lets focus out. The theme or the app owns that code, which is why the trap survives theme updates and app installs alike.

The escape key test

Open every overlay on the store, one at a time, and tab through it. Press Escape. Focus should return to the element that opened the overlay, and the overlay should close. Then tab forward and confirm you can leave the area entirely. If focus cycles inside the overlay, or jumps to the top of the page, or disappears, you have found a trap.

The fix is focus management in the theme or the app, not a plugin. A developer traps focus inside the dialog while it is open, restores it on close, and wires the Escape key. It is a small job once the trap is found, and the finding is the hard part, because it needs a human with a keyboard.

Why automated scans miss it

Scanners cannot tab. They read the code and check for the patterns they know, and a keyboard trap is a behavior, not a pattern. A page can pass every automated check and still trap a keyboard user in its menu, which is why the keyboard pass belongs in the audit routine, ten minutes per template, after every theme change.

Related reading

Related reading: How to test your Shopify store with only a keyboard in 15 minutes, Are Shopify mega menus usable with a keyboard alone? | StorefrontAccess, and A Keyboard Only Checkout Test You Can Run in 20 Minutes.

Frequently asked questions

What is a keyboard trap?

It is a part of a page where keyboard focus goes in and cannot get out by keyboard alone. The focus cycles inside a menu or dialog, or disappears entirely, and the only escape is a mouse. WCAG 2.1.2 forbids it at Level A.

How do I test for keyboard traps?

Use only the keyboard. Tab into every menu, dialog, drawer, and picker on the store, then try to tab out and press Escape. Focus should move through the element and return to where it started. Any place you cannot leave by keyboard is a trap.

Can a trap exist if the mouse works fine?

Yes, and that is the usual case. A trap is invisible to mouse users, which is why it survives for years. It only affects people who navigate by keyboard or switch device, and for them it is a complete block, not an inconvenience.

Which WCAG criterion covers keyboard traps?

Criterion 2.1.2, No Keyboard Trap, at Level A. It requires that keyboard focus can always be moved away from a component using only the keyboard, and that the method is either a standard key or a documented one.