@jolicode/tabto

2.0.0 • Public • Published

tabto - focus to the next input when maxLength is hit

Auto-tabulation / focus for your HTML Form inputs.

Tiny helper that focus user on the next field when a field reach maxLength, like pressing Tab but without stealing the user ability to navigate, copy, paste, Shift+Tab...

<input id="one" data-tab-target="#two" maxlength="10" />
<input id="two" />
import tabto from '@jolicode/tabto';

tabto(document.getElementById('one'));

You can checkout a working demo here.

Install

$ yarn add @jolicode/tabto
$ npm i @jolicode/tabto

We ship multiple versions:

  • CommonJS in dist/index.js;
  • UMD (Universal Module Definition) in dist/browser.js;
  • and ESM (ECMAScript) in dist/index.es.js.

Contributions

Build

  1. $ yarn run build

Run linter

In our case, we use StandardJS rules.

  1. $ yarn run lint

PS: The lint script will fix all autofixable problems.

Run tests

  1. $ yarn run test

Publish

  1. $ yarn run release

Package Sidebar

Install

npm i @jolicode/tabto

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

28.2 kB

Total Files

21

Last publish

Collaborators

  • xavier
  • xavierlacot
  • damienalexandre