Keyboard focus does not get trapped
Design Notes
Design decisions are not relevant.
Developer Notes
Ensure keyboard focus does not get trapped
People using keyboards to navigate and interact with content should be able to do so without the keyboard focus becoming trapped in the content. Make sure all content can be navigated using the Tab key on the keyboard and content which can be entered using the keyboard alone can also be exited this way.
Common issues
- A modal dialogue can be opened with a keyboard but not closed, preventing the user from reaching/returning to the content in the page behind
- Content is presented in an iframe which generates new content on scroll (aka infinite scroll), — forcing many presses of the Tab key before they can continue their journey.
Testing Notes
Keyboard focus does not get trapped
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
Steps to check
- use the keyboard Tab key to progress through interactive page elements (e.g. links, buttons, form inputs) until you reach the end of the document
- use Shift-Tab to navigate the focus in the reverse direction back to the top of the page
- if you encounter any elements that you can't move away from try the standard exit methods (enter, space bar, escape key) and the arrow keys or follow any instructions provided
- are there any elements that you can't move away from?
Impact range: Critical
Test type: Manual
WCAG Reference: Understanding Success Criterion 2.1.2 No Keyboard Trap