Focus trap
Keeping keyboard focus inside an open modal so users can't tab into the hidden page behind it.
Definition
When a modal is open, keyboard focus should move into it, stay inside it while it is open, and return to the element that opened it when it closes. Without this, keyboard and screen reader users get lost in content they can't see.
In practice
Pressing Tab repeatedly in a "Cookie settings" dialog should cycle through its buttons only, never reaching the links on the page underneath.
Learn it in context
Lessons that use this term.
Related terms
- ModalA window that appears on top of the page and blocks the content behind it until it is closed.
- Screen readerSoftware that reads the screen aloud for blind and low-vision users, like VoiceOver or TalkBack.
- WCAGThe Web Content Accessibility Guidelines, the main international standard for accessibility.