2.1.2 No keyboard trap

For people who navigate by keyboard, there is nothing more frustrating than keyboard traps! This criterion states:

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 is a keyboard trap?

A keyboard trap occurs when you navigate by keyboard to somewhere on the page but then can't navigate away from it. For example, I might click on a button, which opens a pop-up box but then, I can't close that box without a mouse. Normal keyboard navigation doesn't work.

In the post about keyboard navigation, the standard key strokes are shown. You should always be able to move around using these standard keys. In the case of the aforementioned pop-up, I would expect to be able to close it by either tabbing to a close button or by hitting ESC.

Non-standard method

If the method of getting out of somewhere needs more than the standard key strokes, then the user must be advised. This means giving an instruction, which must be easy to find, to explain how the feature works with keyboard.

Although there is this exemption that gives you the opportunity to do something non-standard but provide instructions, you have to also consider the user experience. Wouldn't it just be better to make it work in a standard way in the first place?

Many users, when frustrated with something that is difficult to use, will just close the page and do something else instead. Surely you want your site to be easy for everyone to use.