Skip to content

Repository files navigation

Latest Stable VersionLicense

tabwrap

Minimalistic utility to add tab wrapping to any element, such as dialogs and popups.

Installing

using npm

npm install @devlop/tabwrap

Usage

<divclass="dialog"><inputtype="text"><!-- switch + tab here should switch focus to the last <input> --><inputtype="text"><inputtype="text"><!-- tab here should switch focus to the first <input>--></template>
importtabwrapfrom'@devlop/tabwrap';tabwrap(document.querySelector('div.dialog'));

Simplified usage on multiple elements

If you have many places you want to add tab wrapping it can usefull to give all your elements you wish to target the same attribute, for example data-tabwrap, then it's easy to add tab wrapping to them all like this.

importtabwrapfrom'@devlop/tabwrap';document.querySelectorAll('[data-tabwrap]').forEach(function(element){tabwrap(element);});

About

Minimalistic utility to add tab wrapping to any element, such as dialogs and popups.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages