# emulate-tab

> emulate tab key without selector or dependencies

Latest version **1.2.1** (published 2021-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install emulate-tab
pnpm add emulate-tab
yarn add emulate-tab
bun add emulate-tab
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2021-10-05 |
| First published | 2020-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 62.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Emanuel Hein |
| Maintainers | em.hein |
| Keywords | emulate, simulate, browser, user, tab, font-end, keyboard, javascript, focus, tabindex, web |

## Links

- npm: https://www.npmjs.com/package/emulate-tab
- Repository: https://github.com/e-hein/emulate-tab
- Homepage: https://emulate-tab.net-root.de/
- Issues: https://github.com/e-hein/emulate-tab/issues
- npm.io page: https://npm.io/package/emulate-tab

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2021-10-05
- 1.2.0 — 2020-08-12
- 1.1.3 — 2020-08-11
- 1.1.2 — 2020-06-27
- 1.1.1 — 2020-06-26
- 1.1.0 — 2020-06-22
- 1.0.2 — 2020-06-20
- 1.0.0 — 2020-06-18

## README

[![npm (tag)](https://img.shields.io/npm/v/emulate-tab/latest)](https://www.npmjs.com/package/emulate-tab)
![test workflow](https://github.com/e-hein/emulate-tab/actions/workflows/test-coverage.yml/badge.svg?branch=master)

emulate tab
===========
Tries to emulate a tab key press of a real user.

Ever triggered the tab-key-event by javascript? Tab is usually handled by browser and will not get handle if you trigger the event by javascript. This is for security resons to prevent a script to tab e.g. into the browser's menu or into another frame or dev-tools ...  
This script has an heuristic to find the next element to stop. It will trigger the keypress-Event and blur event on the active element and the focus-Event on the next element.

Interactive demo: https://emulate-tab.net-root.de

Installation
------------
```npm i emulate-tab```  
or download unpackaged javascript files from our [releases](https://github.com/e-hein/emulate-tab/releases)

Usage
-----
#### typescript
```ts
import { emulateTab } from 'emulate-tab';

emulateTab();
emulateTab.backwards();
```
[-> complete angular material example project](test/in-angular-material/src/app/app.component.ts)

#### javascript
```html
<script src="emulate-tab.min.js">
<script>
  emulateTab();
  emulateTab.backwards();
</script>
```
[-> complete plain html example project](test/in-plain-html-js/www/sample-form.html)

Dependencies
------------
none.

Browser compatibility:
----------------------
Automated tests for current Chrome and Firefox by github actions: 
![test workflow](https://github.com/e-hein/emulate-tab/actions/workflows/test-coverage.yml/badge.svg?branch=master)

License:
--------
[MIT License](LICENSE)

---
_Source: https://npm.io/package/emulate-tab · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
