A common accessibility bug: a modal is open, but pressing Tab lets focus leak into the background content. Preventing it meant giving every background button, link, and input `tabindex="-1"`, adding `aria-hidden="true"`, and setting `pointer-events:none` in CSS — and re-doing it whenever a new focusable element was added to the background.
A single `inert` attribute on the parent removes the whole subtree from focus, click, text selection, and screen-reader access. Instead of tracking every descendant, it declares "make this entire region dead." `<dialog>.showModal()` handles its background this way internally.
Check caniuse/MDN baseline for support. Without it, manually toggling `tabindex="-1"`/`aria-hidden` on every focusable background element and setting `pointer-events:none` in CSS is still required.
When to use
Fully excluding background content from focus and click while a modal is open.