Accessibility Wiki

A modal dialog should declare aria-modal

Rule dialog-modal · Component patterns (best practice) · impact minor · Static + live

↩ Back to the rules index · WCAG cross-reference

Why it matters

aria-modal="true" tells assistive technology that content outside the dialog is inert while it is open, so AT confines reading to the dialog. Omitting it can let screen-reader users wander out of a modal.

How to fix

Add aria-modal="true" to modal dialogs (and actually keep focus and AT inside the dialog while open); declare aria-modal="false" on intentionally non-modal dialogs. Native

needs neither — its modality follows from show() vs showModal().

Example

✕ Fails
<div role="dialog" aria-label="Confirm">Are you sure?</div>
✓ Passes
<div role="dialog" aria-label="Confirm" aria-modal="true">Are you sure?</div>

Example

✕ Fails
<div role="dialog" aria-label="Chat">Hi there</div>
✓ Passes
<dialog aria-label="Settings"><button>Close</button></dialog>

Native

conveys modality implicitly (show() vs showModal()) and needs no aria-modal.

WCAG success criteria

4.1.2 Name, Role, Value — Level A

Every UI component must expose a correct name, role, and (where relevant) state/value to assistive technology.

Understanding 4.1.2

Standards

This rule contributes to the following standards:

WCAG A EN 301 549 Best practice

Standard Criteria
EN 301 549 9.4.1.2

References