WCAG 2.1.2: No Keyboard Trap
Level AQuick answer: Keyboard users must be able to move into and out of every modal, widget, and embed without getting stuck.
What This Means
On ecommerce sites, No Keyboard Trap usually shows up in repeating storefront components such as product cards, PDP media, search results, cart drawers, checkout forms, and support content. If the live experience depends on patterns like promo popups trap focus with no close button in the tab order. or embedded review widgets capture tab and never return focus to the page., disabled shoppers can lose context or get blocked before purchase.
This criterion matters because D2C teams often fix the homepage but miss reusable app blocks, campaign pages, and mobile-specific UI. The practical standard is simple: build the same outcome for keyboard users, screen-reader users, low-vision users, and anyone relying on captions, labels, structure, or predictable behavior.
For Shopify, WooCommerce, and custom storefronts, the fastest remediation path is usually template-level work. Fix the repeated component once, then retest every place it appears across browse, buy, and post-purchase journeys.
Common Violations on Ecommerce Sites
- Promo popups trap focus with no close button in the tab order.
- Embedded review widgets capture Tab and never return focus to the page.
- Quick-view modals loop incorrectly and skip the close control.
- Support chat launchers move focus into an iframe with no exit shortcut.
How to Fix It
Start with the live customer journey, not isolated components in Storybook or Figma. Audit the problem on category pages, product detail pages, quick views, cart, checkout, account, and help templates.
- Manage focus inside modals intentionally and always provide a reachable close control.
- Return focus to the triggering element when the dialog closes.
- Avoid custom key handling that blocks Tab or Shift+Tab from working normally.
- Test third-party widgets because keyboard traps often come from embeds.
On Shopify, fix the theme section or app block that repeats the defect. On WooCommerce and WordPress, update the template override or plugin output. In custom React or headless storefronts, move the fix into shared components so merchandisers cannot reintroduce the issue with every campaign.
Code Example
<!-- Before -->
document.addEventListener('keydown', e => { if (e.key === 'Tab') e.preventDefault(); });
<!-- After -->
dialog.addEventListener('close', () => trigger.focus());
FAQ
What is WCAG 2.1.2?
Keyboard users must be able to move into and out of every modal, widget, and embed without getting stuck.
How does WCAG 2.1.2 affect ecommerce sites?
It affects ecommerce anywhere shoppers interact with promo popups trap focus with no close button in the tab order. and embedded review widgets capture tab and never return focus to the page. If those patterns are inaccessible, customers can miss product information, fail forms, or abandon checkout.
How to fix WCAG 2.1.2 violations?
Start by auditing the live storefront, then Manage focus inside modals intentionally and always provide a reachable close control.; Return focus to the triggering element when the dialog closes.; Avoid custom key handling that blocks Tab or Shift+Tab from working normally.. Prioritize templates and apps that repeat the issue across product, cart, checkout, and account pages.
Check if your store passes WCAG 2.1.2 → Free ADA Compliance Scan