A11ying with Sanna - Web Content Accessibility Guidelines a guide to the accessibility requirements
2 Operable

2.1.2 No Keyboard Trap

Conformance level: A
Criterion released in WCAG version: 2.0

Official description of the success criterion

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.

What to do?

Ensure keyboard focus is not trapped in any part of the content.

Why is it important?

Allows users to navigate through content using the keyboard.

Common pitfalls

Sometimes <div> elements are used instead of buttons. If keyboard support isn't added to such elements separately, they cannot be accessed with a keyboard. If this type of an implementation is created for a close button of a modal, then it is very possible to get stuck inside the element.

How to test for it?

Check all content for keyboard traps. It's usually easiest to test these manually. And you can test both 2.1.1 and this one at the same time.

More about this criterion elsewhere