# js-email-autocomplete

> Npm package that propose autocomplete suggestions for email input fields.

Latest version **1.0.3** (published 2018-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-email-autocomplete
pnpm add js-email-autocomplete
yarn add js-email-autocomplete
bun add js-email-autocomplete
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-10-26 |
| First published | 2018-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Martin Petit |
| Maintainers | martinpetit |
| Keywords | vanilla, js, javascript, autocomplete, suggestion, typeahead, domain, email, form |

## Links

- npm: https://www.npmjs.com/package/js-email-autocomplete
- Repository: https://github.com/NicoleEtLui/email-autocomplete
- Issues: https://github.com/NicoleEtLui/email-autocomplete/issues
- npm.io page: https://npm.io/package/js-email-autocomplete

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-10-26
- 1.0.2 — 2018-10-26
- 1.0.1 — 2018-10-26
- 1.0.0 — 2018-10-26

## README

# js-email-autocomplete

> NPM package that suggests and autocompletes the domain whenever your users type in an email address field.

## What does it do?

When your user types in "user@gm", the plugin will suggest for e.g. "user@gmail.com", based on the first result from a list of predefined email domains.

![diagram](https://raw.github.com/10w042/email-autocomplete/master/doc_assets/example.png)

Press the tab-key, or simply click on the suggestion to automatically fill in the rest of the domain. (or tap on the suggestion for mobile users.)

You can also use the right arrow key.

## Installation

**Download**

```
npm install js-email-autocomplete
```

## Usage

`emailautocomplete(element<Dom Node>, {domains<String[]>, suggClass<String>})`

`element`: Dom input field on wich apply autocompletion.
`domains` : Array de string specifying specific domain that will be added on top of the default list. (default)
`suggClass` : classname used to style the domain suggestion (default: `eac-sugg`)

```html
<input id="targetField" type="email" placeholder="Enter email">
```

```js
import emailautocomplete from 'js-email-autocomplete'

const elem = document.getElementById('targetField')
emailautocomplete(elem, {
  domains: ["example.com"], //add your own specific domains to top of default list
  suggClass: 'eac-suggestion' //add your own class
});
```

## Domains

These are the plugin default domains.

* gmail.com
* googlemail.com
* yahoo.com
* yahoo.co.uk
* hotmail.com
* hotmail.co.uk
* live.com
* msn.com
* comcast.net
* sbcglobal.net
* verizon.net
* facebook.com
* outlook.com
* att.net
* gmx.com
* icloud.com
* me.com
* mac.com
* aol.com

## Author

- Martin Petit


## Known Issues

* On Android stock browser, if "Settings > Accessibility > Scale text up and down" value is not at 100%, the text width will be calculated incorrectly.

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