What is an inert element?

Asked

Viewed 219 times

4

I asked a question about tabindex here on the site and ended up bumping into the term inert elements.

I realized it’s something that’s in specification of w3c, and on top of that there is a Polyfill for the attribute "Inert".

About that I have some doubts:

  • What would be an inert element?
  • In HTML5, an attribute will exist or exists that marks an element as inert?
  • If this is new, what can change with the implementation?

1 answer

2

It is a Feature that is in development, but is currently not active in existing browsers.

The Inert attribute is a draft Feature of HTML. As of Feb 2017, no browser >has a Native implementation of Inert. However, there is active Development >Inside Chrome, and other browsers have Shown some renewed interest.

From the HTML spec-

A Node (in particular Elements and text nodes) can be marked as Inert. >When a Node is Inert, then the user agent must Act as if the Node was >absent for the purposes of Targeting user Interaction Events, may ignore >the Node for the purposes of text search user interfaces (commonly known >as "find in page"), and may Prevent the user from Selecting text in that >.

It is a Feature that allows you to disabilitate components, either for Focus/activation/selection but also make searching impossible.

It is an attribute that should be optional for all possible uses in the near future if it enters production phase.

There are already those who are preparing components and scripts for the inclusion of Inert, trying to overcome the current limitation of browsers not recognizing the injecting attribute via script.

References:

W3C Html 5.1 Inertness - https://www.w3.org/TR/html51/editing.html#inertness

Polyfill for the HTML Inert attribute Github - https://github.com/GoogleChrome/inert-polyfill

Browser other questions tagged

You are not signed in. Login or sign up in order to post.