Skip to main content
WCAGrules
Quick navigation

ARIA property

aria-modal

Says everything behind this dialog is unavailable, so a screen reader stops at its edge.

It tells assistive technology that the rest of the page is out of play while this element is showing. Nothing about the page actually becomes inert. Reading stops at the dialog's edge. Pointer and keyboard access to what is behind it carries on exactly as before.

Which roles may carry aria-modal

Value
true/false
Filed as
A property, which is how ARIA files it and not a rule about how often it changes.
Roles that may carry it
window
Roles that inherit it
alertdialog, dialog

Those lists are not advice. Browsers are required to ignore a non-global attribute sitting on a role that does not support it, so aria-modal on the wrong element is not weak, it is absent. You can read it in the DOM and nobody using a screen reader can.

Every role above comes from the specification's own list for this attribute, checked name for name. The normative definition stays with the W3C, in the aria-modal section of the ARIA specification.

Keeping aria-modal true

It is a claim rather than a mechanism, and you have to keep it true yourself in two places. The first is the attribute, which has to come off or go false when the dialog closes, or the page behind it stays unreachable to a screen reader long after the dialog is gone. The second is the interface, and the spec makes it a requirement. Everything needed to control the dialog has to be a descendant of it, so a close button parked outside the dialog element leaves a screen reader user with no way out of the one thing they were told was available.

How aria-modal gets checked

There are test rules that check an ARIA attribute is one that exists, is allowed on the role underneath it, and carries a value of the right type. What they map to is ARIA's own author requirements rather than any WCAG criterion, so a misplaced attribute breaks ARIA without being a WCAG failure by itself. It becomes one under 4.1.2 Name, Role, Value the moment the missing or wrong value means the control's state cannot be worked out programmatically, which is what usually happens next.

Nothing automated catches the failure this page is about. A stale value is a valid value, on a permitted role, with the right type. It is only wrong about the world.

Every ARIA state and property · Every ARIA role · ARIA explained

Go somewhere useful

Find tools, resources and your workspace.

29 destinations