Keyboard Trap¶
The accessibility failure where a keyboard-only user moves focus into a UI element that receives focus but never yields it — an absorbing state in the focus-navigation graph, invisible to mouse users because a click supplies the exit edge they lack.
Core Idea¶
A keyboard trap is the accessibility failure in which a user navigating by keyboard alone moves focus into a UI element from which they cannot exit using keyboard input. The interface keeps accepting keyboard events but does not forward the standard focus-movement keys (Tab, Shift+Tab, Escape) outward. The structural commitment is an asymmetry of focus entry and exit: recast as a directed navigation graph, the trapping element is an absorbing state — reachable by inbound Tab but with no keyboard-reachable outbound transition. For a mouse user, a click anywhere exits trivially.
Scope of Application¶
Keyboard trap lives within HCI and accessibility engineering — wherever an interface is navigated by focus-driven keyboard or switch input and a focusable container receives focus without yielding it.
- WCAG 2.1.2 "No Keyboard Trap" — the Level A criterion written directly for this failure.
- Modal-dialog implementations — intended containment becoming a trap when Escape and close are unwired.
- Third-party embedded widgets — date pickers, editors, players, and OAuth iframes cycling Tab internally.
- Custom keyboard widgets — spinners and combo-boxes wired for
tabindexreceipt but omittingkeydownexit. - Switch/scan access — single-key input where "advance" is the only action, making an absorbing state severe.
Clarity¶
The label makes a modality-relative failure visible to developers who do not experience it: for a mouse user the widget is unremarkable, so bug reports read "works for me." Recasting the interface as a navigation graph exposes the asymmetry — an element wired to receive focus but not to yield it is an absorbing state, a no-exit room for someone whose interface is that graph. It also draws the line between an intended focus trap and the failure: the defect is containment without a keyboard-reachable exit.
Manages Complexity¶
A miscellany of hiding places — modals, iframes, plugins, hand-rolled combo-boxes, across browsers — is too large to certify by inspection. The concept collapses it by recasting the interface as one directed navigation graph, so implementation details become incidental and only one graph-theoretic invariant matters, evaluated at every focus-containing node: is exit keyboard-reachable? Because it is a reachability property, it is mechanisable — one test catches every member and any not-yet-seen widget.
Abstract Reasoning¶
The concept licenses a modality-relative diagnostic (overturn "works for me" by relocating the fault from user to a missing outbound edge), a boundary-drawing check of one reachability invariant at every focusable node, a second boundary-drawing move separating the trap from focus theft, tab-order discontinuity, and the inert background region, and an interventionist move (install the missing outbound edge — wire Escape, forward Tab, supply a close affordance — plus change the test posture).
Knowledge Transfer¶
Within accessibility and UI engineering the concept transfers as mechanism, because the navigation-graph invariant is implementation-agnostic: the same check, WCAG criterion, and prescription carry across modals, widgets, iframes, plugins, mobile screen readers, and switch access. Beyond UI the same structure recurs as co-instances — a phone tree with no "back," a bureaucratic dead-end, a recommendation loop — an actor stranded in a state their action modality cannot exit. That portable lesson belongs to the parent absorbing_state_under_restricted_modality, of which keyboard trap is the focus-graph instance; the Tab/Escape/WCAG apparatus stays home.
Relationships to Other Abstractions¶
Current abstraction Keyboard Trap Domain-specific
Parents (1) — more general patterns this builds on
-
Keyboard Trap is a decomposition of Absorbing State Under Restricted Modality Prime
Removing focus-navigation and WCAG vocabulary leaves the exact live prime: a reachable state with no exit in the actor's available action modality.
Hierarchy path (1) — routes to 1 parentless root
- Keyboard Trap → Absorbing State Under Restricted Modality → State and State Transition → Phase Space
Neighborhood in Abstraction Space¶
Keyboard Trap sits in a moderately populated region (41st percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.
Family — Interface Legibility & Navigability (12 abstractions)
Nearest neighbors
- Keyboard Accessibility — 0.90
- Screen-Reader Ambiguity — 0.86
- Navigation loop — 0.85
- Orientation Loss — 0.84
- Operable Design — 0.84
Computed from structural-signature embeddings · 2026-07-12