Keyboard
Do not remove an iframe from the tab order when it has content
- Rule:
frame-focusable-content - Severity: Serious
- WCAG level A
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
- Remove tabindex="-1" from the iframe.
- If the frame really has nothing to interact with, remove its focusable content instead.
In markup
<iframe src="/widget" title="Chat" tabindex="-1"></iframe><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:
- 2.1.1 Keyboard (opens in new tab) — WCAG level A
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.