inert attribute
An HTML attribute that makes an element and everything inside it unclickable, unfocusable and hidden from assistive technology.
In more detail
Setting inert on the main application while a modal is open blocks the mouse, keyboard and screen readers from the background in one step. aria-hidden only hides content from screen readers and leaves it focusable, so inert is the stronger choice.
Related terms
- aria-hidden — An ARIA attribute that removes an element and everything inside it from the accessibility tree, while leaving it visible and clickable.
- modal dialog — A window laid over the page that users must deal with before returning to the page beneath, with role="dialog" and aria-modal="true".
- focus trap — Code that keeps keyboard focus inside a container, such as an open modal, wrapping from the last element back to the first.
Taught in
- Overlay Architecture: Portals, Stacking Contexts & Backdrops — Design Systems & Component Engineering
- WAI-ARIA Semantics: Roles, States & Accessible Name Computation — Design Systems & Component Engineering