Start scanning free

( Operable / WCAG 2.4.3 )

Modal is missing focus management

This check maps to Focus Order. Use the guidance below to confirm the issue, understand who it affects and ship a fix.

Moderate Level A WCAG 2.4.3 — Focus Order

What’s wrong

A visible modal or overlay does not manage keyboard focus — focus is not moved inside when it opens, and not returned to the trigger when it closes.

Why it matters

Keyboard users and screen reader users will remain focused on content behind the modal, making the modal inaccessible.

How to fix it

When a modal opens, move focus to the first focusable element inside it or to the modal container (add tabindex="-1" to the container). When it closes, return focus to the element that triggered it.

Before
modal.style.display = 'block';
After
modal.style.display = 'block';
modal.focus(); // modal has tabindex="-1"

Learn more