Focus trap
A focus trap is a JavaScript pattern that contains keyboard focus inside a modal dialog or other transient container, preventing Tab from leaving the dialog while it is open.
Detailed explanation
Modal dialogs (cart drawers, newsletter popups, image lightboxes) open on top of the rest of the page, but the underlying page still has focusable elements. Without a focus trap, pressing Tab while a modal is open moves focus into the underlying page — confusing for keyboard users and breaking the screen-reader expectation that the modal is the active region.
A correctly-implemented focus trap: (1) moves focus to the modal's first focusable element on open, (2) cycles Tab/Shift+Tab through the modal's focusable elements only, (3) closes on Escape, (4) returns focus to the triggering element on close. This is the recipe in the WAI-ARIA Authoring Practices Dialog pattern.
How this applies to Shopify stores
Cart-drawer modals, newsletter popups, search overlays, and image lightboxes in Shopify themes routinely lack focus traps. AccessComply patches the theme JavaScript to add focus-trap behavior, Escape-key handling, and focus-return logic per the WAI-ARIA dialog pattern.
What merchants should check next
Treat this term as a practical audit prompt, not just a definition. Check the storefront pages where the concept shows up in real customer journeys: product discovery, add-to-cart, cart drawer, checkout handoff, account login, and support contact flows. If the issue affects code, verify the rendered HTML and computed browser output after the theme change. If it affects copy or media, keep the merchant-facing wording accurate and easy to maintain.
Primary source: w3.org