tab-out-catcher

1.0.5 • Public • Published

tab-out-catcher

This is a simple lib to wrap a container (such as form) and prevent jumping out from it by pressing Tab-button

get started

  1. import tab-out-catcher.min.js from root directory (tag script)
  2. get the container of form to wrap
  3. execute catchTheTab function with selected form
<html>
  <head>
    ...
    <!-- 1 menu item -->
    <script src="./tab-out-catcher.min.js"></script> 
  </head>
  <body>
    <form id="wrap-it">
      <input />
      <input />
      <input />
    </form>
    <script>
      // 2  menu item
      var wrapIt = document.getElementById("wrap-it");
      // 3  menu item
      catchTheTab(wrapIt);
    </script> 
  </body>
</html>

npm

https://www.npmjs.com/package/tab-out-catcher

react

tab-out-catcher with react:
npm https://www.npmjs.com/package/react-tab-out-catcher
github https://github.com/kpodmasko/react-tab-out-catcher

example

try it first:

https://codepen.io/xknowledgeless/project/full/XMJLvg

if something went wrong:

https://kpodmasko.github.io/tab-out-catcher/

Readme

Keywords

Package Sidebar

Install

npm i tab-out-catcher

Weekly Downloads

14

Version

1.0.5

License

MIT

Unpacked Size

19 kB

Total Files

7

Last publish

Collaborators

  • kpod