New Tool Radar

AI Design Workflows

How to Check an Accessible Modal Dialog in an AI Design

Check that a modal dialog in an AI design traps focus and can be closed, so a keyboard user is never stuck behind it.

Schematic diagram: three dialog checks — focus moves inside on open, Tab stays inside, and Escape closes it — with focus left behind the dialog failing.

A modal dialog takes over the screen: everything behind it is dimmed and, for a keyboard user, must be unreachable until the dialog closes. When focus is left behind the dialog, or Tab wanders onto the page underneath, the reader is operating a page they cannot see — and when there is no keyboard way to close it, they are stuck.

A dialog must be an escape room with a door

WCAG 2.4.3 Focus Order requires focus to move in an order that preserves meaning and operability, and the W3C’s examples describe modal dialogs directly: when the trigger is activated, a dialog opens and focus is set to the first interactive element in the dialog. WCAG 1.3.1 requires the dialog’s role and name to be programmatically determined, so a screen reader announces it as a dialog rather than reading it as ordinary page content. See also our keyboard accessibility check.

Expected result. We checked the sources listed below. We did not run any design tool or browser on the Maple Corner design.

The table below is fictional practice material: six items in a Maple Corner design. Results are practice values for the exercise.

Practice dialog check: fictional Maple Corner newsletter dialog

Dialog part Accessibility check Result
Open action Focus moves to the first field when it opens Pass
Tab order Tab cycles inside the dialog only Pass
Close button Reachable by keyboard, labelled Close Pass
Escape key Escape closes the dialog Pass
Focus on close Focus stays where the dialog was Fail — return focus to the button that opened it
Background page Page behind stays reachable by Tab Fail — trap focus until the dialog closes

4 of the six items pass, and 2 fail. The passing items share one property: they were checked against the rule before the design was finished, not after. The failing items are the ones to fix first — each has its fix named in the table.

How to fix it

On open, move focus into the dialog; while it is open, keep Tab cycling inside it; on close, return focus to the control that opened it. Give the dialog a name and a labelled close control, make Escape close it, and announce the dialog’s purpose — never open a dialog without telling the reader what it is.

Limits

  • No design tool or browser was run on the Maple Corner dialog, and Maple Corner is fictional. The table above is the expected result for the practice items, not a test of any product.
  • A modeless dialog follows different rules: its content sits in the focus order after its trigger, and the page behind stays usable.
  • This guide checks modal dialogs. Confirmation dialogs and lightboxes need the same focus treatment.

Sources

See all