Rampsight

All rules

Keyboard

Do not remove an iframe from the tab order when it has content

Why it matters

tabindex="-1" on an iframe takes the frame out of the tab sequence but not the controls inside it, which become unreachable by keyboard while still being announced.

How to fix it

  1. Remove tabindex="-1" from the iframe.
  2. If the frame really has nothing to interact with, remove its focusable content instead.

In markup

Fails
<iframe src="/widget" title="Chat" tabindex="-1"></iframe>
Passes
<iframe src="/widget" title="Chat"></iframe>

The requirement behind it

This rule is one way of failing the following WCAG 2.2 success criteria. The W3C, which writes the standard, explains each of them:

Further reading

Deque University on frame-focusable-content (opens in new tab)

Deque maintains axe-core, the open-source engine our scanner runs. Their page documents the rule as the engine implements it.

Automated checks find failures a browser can prove. They cannot judge whether a caption is accurate, whether an alt text is useful, or whether a page can be operated end to end with a keyboard — those need a person.