2.0.0-0 • Published 7 years ago

pmx-inert-elem v2.0.0-0

Weekly downloads
25
License
-
Repository
-
Last release
7 years ago

Inert Elem:

Intro

Module to manage the focusable state of an element and its children.

Getting Started

import inertElem from 'pmx-inert-elem';

const el = document.querySelector('.')
const inertStateHandler = inertElem({ elem: el });
// will make el and its children non focusable
inertStateHandler.isInert(false);
// will restore focus on el and children
inertStateHandler.isInert(false);

How to use

Setup

The module is exported as an UMD module so it can be used with AMD, CommonJS, ES Modules and in the browser.

  • Install the dependency Using Yarn
yarn add pmx-inert-elem

or using NPM

npm install pmx-inert-elem --save
  • Include the module

CommonJS

const inert = require('pmx-inert-elem').default;

ES2015 modules

import inert from 'pmx-inert-elem';

API

.isInert(Boolean)

true: Will make the element and its children non focusable false: Will restore its previous focus state

Browser Support

  • IE 10+
  • Chrome
  • Firefox
  • Safari

This library has been written with some ES2015 features that need to be polyfilled:

  • Map
  • Array.from
2.0.0-0

7 years ago

1.0.0

7 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago