@fantassin/focusable

1.1.0 • Public • Published

If you want to manage focusable element in your DOM with Vanilla JS.

📦 How to install this project ?

npm install @fantassin/focusable

How it works ?

You can declare focusable element by its container. All focusables are detected automatically. The focusableStack keep in memory focuses history.

import { focusableStack, FocusableElement } from '@fantassin/focusable';

let element = new FocusableElement( document.querySelector('.container') );

// element.trapFocus();
// element.disableFocus();
// element.restoreFocus();
// element.enableFocus();
// element.trapFocus();

// focusableStack.setCurrent(element);
// focusableStack.restorePrevious();

Readme

Keywords

none

Package Sidebar

Install

npm i @fantassin/focusable

Weekly Downloads

0

Version

1.1.0

License

ISC

Unpacked Size

7.73 kB

Total Files

9

Last publish

Collaborators

  • truchot
  • suriteka
  • maite-fantassin