The inert attribute allows web authors to mark parts of the DOM tree as inert. When a node is inert: - Hit-testing must act as if the 'pointer-events' CSS property were set to 'none'. - Text selection functionality must act as if the 'user-select' CSS property were set to 'none'. - If it is editable, the node behaves as if it were non-editable. - The user agent may ignore the node for the purposes of find-in-page. (also aboxhall@)
Developers need to make content temporarily non-interactive in a range of circumstances; the most common is when implementing modal UI, but other examples include previous/next slide previews in a slide show, and making currently inactive content non-interactive during verification or other other time-consuming blocking operations. While the modal UI use case would benefit from an API directly addressing that use case, any API designed for that case would still need to use the concept of inertness, and this API is a very minimal addition to that concept which is easy for developers to understand, which enables all of the use cases described above, including non-modal cases.
Docs: https://github.com/WICG/inert#tldr https://discourse.wicg.io/t/inert-attribute/1838/ https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
Samples: https://wicg.github.io/inert/demo/
Explainers: https://github.com/WICG/inert/blob/main/explainer.md