2.0.0 • Published 6 years ago

@jolicode/tabto v2.0.0

Weekly downloads
51
License
MIT
Repository
github
Last release
6 years ago

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