• Success Criterion 2.1.2
  • Conformance level A
  • W3C reference F10

Keyboard Focus Stuck Inside an Embedded Plugin or Widget

2.1.2 — No Keyboard Trap

Scenario

Setting

An email client's compose window

What’s wrong

Keyboard focus can get stuck inside an embedded plugin/format (video player, widget) and the user cannot Tab back out to the rest of the page.

Example

// modal traps Tab inside with no Escape handler

Why it matters

All keyboard and screen-reader users who can become stuck inside a component.

How to test

Tab into any embedded plugin/format (PDF viewer, old Flash-style widget): confirm Tab or Shift+Tab can move focus back out to the surrounding page.

How to fix

Ensure focus can Tab out of every embedded format/plugin back to the page. document.addEventListener('keydown', e => { if (e.key === 'Escape') closeModal(); }); Any component that captures focus needs a standard way out — Escape, or focus cycling back to a close control.

Outcome

On an email client's compose window, this barrier is gone for all keyboard and screen-reader users who can become stuck inside a component — they can complete the task without hitting this wall.

Who is affected

All keyboard and screen-reader users who can become stuck inside a component.

Learn more