Skip to main content

What are Keyboard Traps?

Keith Bundy avatar
By Keith Bundy

WCAG 2.0 guideline 2.1.2 states that there should be no keyboard traps. A keyboard trap occurs when a user can get into a component or element on a web page by using the keyboard but cannot get out of that component or element through the use of the keyboard.

Who Is Affected?

Keyboard traps primarily affect two types of users.

  • Users who are blind or who have a significant visual impairment cannot use the mouse for navigation. Consequently, their only method of navigating a web page is by using the keyboard.

  • Users who have limited or no use of their hands cannot navigate a page using the mouse. There are several ways in which these individuals can get around a page, but these methods primarily involve keyboard navigation in some form. For example, users of dictation software are actually giving keyboard commands to programs by using their voices.

How Can Keyboard Traps Be Avoided?

The primary key to avoiding keyboard traps is awareness. Make sure that all elements of your web page can be gotten into, and out of, by using only the keyboard. Be especially mindful of this when using Javascript and when embedding videos. Always approach your page with the question, “How could I navigate this page if I couldn’t use a mouse?”.

Was this article helpful?
1 out of 1 found this helpful