♿Focus Trap
Also known as Keyboard Trap, Focus Lock
The Tab key stays in one box, like a pop-up. It stays till you close it.
Think of it like
It is like a fenced garden. Inside a pop-up you stay in the fence until you use the gate.
Example
In a cookie dialog, Tab cycles through Accept and Settings. Escape closes it and focus returns to the page.
Why it matters
Done right, it stops people tabbing into a page they cannot see. Done wrong, it locks them in.
Definition
Common mistake
Key takeaways
- 1Wanted in a modal. Tab loops inside.
- 2Always an exit. Escape or Close.
- 3Return focus. Back to where it was.