Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/WICG/inert
Polyfill for the inert attribute and property.
https://github.com/WICG/inert
Last synced: 3 months ago
JSON representation
Polyfill for the inert attribute and property.
- Host: GitHub
- URL: https://github.com/WICG/inert
- Owner: WICG
- License: other
- Created: 2016-06-29T22:05:17.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-07-24T16:13:52.000Z (4 months ago)
- Last Synced: 2024-07-24T18:41:53.470Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.43 MB
- Stars: 922
- Watchers: 33
- Forks: 80
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: security-privacy.md
Awesome Lists containing this project
README
The `inert` attribute/property allows web authors to mark parts of the DOM tree
as [inert](https://html.spec.whatwg.org/multipage/interaction.html#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 node.Furthermore, a node which is **inert** should also be hidden from assistive
technology.# Details
- Read the [Explainer](explainer.md).
- Read the [Spec](https://whatpr.org/html/4288/interaction.html#the-inert-attribute).
- Try the [Demo](https://wicg.github.io/inert/demo/).
- [Give feedback!](https://github.com/WICG/inert/issues)# Polyfill
## Installation
`npm install --save wicg-inert`
We recommend only using versions of the polyfill that have been published to
npm, rather than cloning the repo and using the source directly. This helps
ensure the version you're using is stable and thoroughly tested.This project provides two versions of the polyfill in `package.json`.
- `main`: Points at `dist/inert.js` which is transpiled to ES3.
- `module`: Points at `dist/inert.esm.js` which is transpiled to ES3._If you do want to build from source, make sure you clone the latest tag!_
## Usage
### 1. Either import the polyfill, or add the script to your page
```
import "wicg-inert";
```OR…
```html
...