Websites must ensure that keyboard focus is not trapped between the subsections of content in the webpage. This ensures that people who rely on a keyboard or keyboard interface to access the web can easily navigate the website.
Table of Contents
Official Requirements
2.1.2 No Keyboard Trap: 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. (Level A)
Note: Since any content that does not meet this success criterion can interfere with a user’s ability to use the whole page, all content on the Web page (whether it is used to meet other success criteria or not) must meet this success criterion. See Conformance Requirement 5: Non-Interference.
Why is it required?
People with vision impairments or physical impairments usually access websites using a keyboard or keyboard interface. Therefore it is essential that the keyboard focus does not get trapped within the content subsection while they are going through your website. The keyboard trap is a common issue when websites try to combine multiple formats within a page and render them using plug-ins.
How do we fix it?
Take steps to ensure that keyboard focus can move into any element and away again
Mistakes to avoid
- A dialogue box or a pop up opens up but the user doesn’t have the option to close, preventing them from accessing the content that is under it
- Website content is presented in infinite scroll format, i.e. new content is loaded continuously as the user scrolls down the page. This feature is problematic for keyboard users as they are forced to tab through everything before they can exit the scroll area.
Reference