What Is a Keyboard Trap on a Website?
A keyboard trap is a part of a page that a person can enter with the keyboard and can't leave without a mouse. What WCAG asks, who it stops, and where traps tend to hide.
Ash Harris4 minute read
A person filling out a form with the keyboard reaches a date picker, a chat window, or an embedded map. The Tab key takes them in. Then every press of Tab, Escape, or an arrow key leaves them in the same place, and the rest of the page is out of reach. Without a mouse, the way out is often to reload the page and start again.
What the standard asks
WCAG success criterion 2.1.2, No Keyboard Trap, sits at Level A, the base of the standard. W3C's wording (opens in a new tab) is this: "If keyboard focus can be moved to a component of the page using a keyboard interface, then focus can be moved away from that component using only a keyboard interface, and, if it requires more than unmodified arrow or tab keys or other standard exit methods, the user is advised of the method for moving focus away."
In plain terms, anything a person can enter with the keyboard, they can leave with the keyboard. If leaving takes an unusual key, the page says which one. W3C attaches a note that sets this criterion apart from most: content that fails it "can interfere with a user's ability to use the whole page," so every part of the page has to meet it, whatever else that part is for.
Who a trap stops
W3C names the people the criterion protects: "People who rely on a keyboard or keyboard interface to use the web including people who are blind and people with physical disabilities." That includes people who use a screen reader, which is run from the keyboard, and people who can't hold or steer a mouse because of a tremor, paralysis, or limited movement.
For each of them, a trap ends the task. A form that can't be left can't be submitted, and a payment page with a trapped widget can't be paid.
Where traps tend to hide
- Pieces of a page supplied by another company: a chat window, a video player, an embedded map, or a booking or payment form loaded from a vendor.
- Pop-up windows that rightly hold the keyboard inside while open, but offer no way to close them from the keyboard.
- Custom controls, such as a date picker or a text editor, that take over the arrow and Tab keys and never hand them back.
The first kind matters for ownership. A trap inside a tool the organization bought still sits on the organization's page, and the obligation stays with the organization, whatever the vendor promised.
Why the fix is usually contained
A trap usually sits in one component, so the fix sits there too: a working Escape key, a close button the keyboard can reach, or code that hands control back to the page. When the component comes from a vendor, the fix is the vendor's to make, and the request carries more weight with a dated finding attached.
Finding one takes no special software. With the mouse set aside, the question for each part of the page is whether the Tab key can leave it as easily as it went in.
What a dated record adds
A trap is easy to describe in a complaint: the person got in and could not get out. An organization holding a dated record can show when the trap was found, when the vendor was asked to fix it, and the day it stopped being found. Esther assesses a site and dates every finding, which gives that sequence its dates.
Questions about your own site
- Can every part of your most-used form, including any date picker or chat window, be left with the Tab key?
- When a pop-up window opens on your site, can it be closed without a mouse?
- For each tool on your site that a vendor supplies, has anyone checked that the keyboard can get back out?
A keyboard trap is one of the few barriers that can stop a task outright, and one of the more contained to correct. Title II's side of it, for state and local governments, is set out at For government. The private side is at For business.
Sources: WCAG 2.2 success criterion 2.1.2, No Keyboard Trap, its note, and its Understanding document, as published by the W3C. The criterion's wording is the same in WCAG 2.1. Read November 4, 2026.
About the author

Ash Harris is Esther's Chief Global Growth Officer. He has worked in web accessibility for twenty years, advising government, global banks, major retailers, and universities, and served on the W3C's Education and Outreach Working Group from 2018 to 2023.
