Keyboard trap
A keyboard trap leaves keyboard users stuck within a region. Deliberately containing focus in a dialog needs a keyboard-operable exit.
A keyboard trap occurs when someone can reach a region using the keyboard but cannot leave it using the keyboard. A mouse pointer outside the region does not help people who depend on keyboard interaction.
Be able to leave a dialog
In a fictional portal, focus stays inside a confirmation dialog while it is open. Keeping focus there is not itself a keyboard trap. The person should be able to make the decision or close the dialog through an understandable keyboard route. They must then be able to continue using the interface.
Test the complete route
W3C distinguishes an inescapable trap from containment with a known exit. A special exit mechanism needs a suitable explanation if it goes beyond the usual keyboard methods. Check entering, operating and leaving the region. A visible close button is not enough if it cannot be reached using the keyboard.
Sources
Related terms
- Focus orderFocus order determines the route through focusable elements. It should preserve meaning and operability, including during dynamic changes.
- Skip linkA skip link bypasses repeated navigation and leads to the main content. The destination must also work for subsequent keyboard navigation.
- Accessible nameAn accessible name labels a control for assistive technology. It should explain the action and agree with the visible text.
- Search suggestionA search suggestion offers a possible query while someone types. Selection, submission and the later results list need to work together clearly.
- Interactive prototypeAn interactive prototype responds to selected actions. It can reveal a path through an interface without implementing the real processing behind it.
- PrototypeA prototype makes a design testable against a specific question. Its form and scope follow the uncertainty that needs to be resolved.
Articles on this topic








Design & UX with ASES
User experience, interfaces and brand presence

