question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[DOM] Add support for the `inert` attribute

See original GitHub issue

Do you want to request a feature or report a bug?

Feature

What is the current behavior?

When specifying inert={false} on an element, React throws the following message:

Warning: Received `false` for a non-boolean attribute `inert`.

However, inert={undefined} works fine as a replacement for false, while inert="" (empty string) provides an escape hatch as a truthy value.

What is the expected behavior?

The inert attribute should be accepted as a boolean DOM attribute, as proposed by the HTML Standard.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
MidnightDesigncommented, Jun 14, 2022

The inert attribute will be supported by all major engines very soon and this issue should be reopened.

1reaction
awearycommented, Oct 21, 2019

@kripod it looks like the spec doesn’t explicitly define an inert attribute yet

This section does not define or create any content attribute named “inert”. This section merely defines an abstract concept of inertness.

We should probably wait until the spec defines this as a boolean attribute before adding it to the list. In the meantime the workaround you mentioned with inert="" should be sufficient!

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTMLElement.inert - Web APIs | MDN
The HTMLElement property inert reflects the value of the element's inert attribute. It is a boolean value that, when present, makes the browser...
Read more >
inert | Polyfill for the inert attribute and property. - GitHub Pages
The inert attribute/property allows web authors to mark parts of the DOM tree as inert: ... Either import the polyfill, or add the...
Read more >
Non-interactive Elements with the inert attribute
What is the inert attribute? · It is not focusable. · It behaves similarly to aria-hidden="true" for assistive technologies ...
Read more >
"inert" attribute - HTML
The inert attribute would allow web authors to mark parts of the DOM tree as inert: When a node is inert, then the...
Read more >
Using HTML inert property to manage user focus
Using inert in incompatible browsers ... It is good practice to think of the instances where new features might not be supported and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found