# ember-cli-keyboard-nav

> Easy dropdown menu keyboard navigation for Ember.

Latest version **1.0.0** (published 2018-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-cli-keyboard-nav
pnpm add ember-cli-keyboard-nav
yarn add ember-cli-keyboard-nav
bun add ember-cli-keyboard-nav
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-05-11 |
| First published | 2017-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^4.5 \|\| 6.* \|\| >= 7.* |
| Dependencies | 1 |
| Unpacked size | 215.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | timjcook |
| Keywords | keyboard, dropdown, navigation, nav, form, ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-cli-keyboard-nav
- Repository: https://github.com/timjcook/ember-cli-keyboard-nav
- Homepage: https://github.com/timjcook/ember-cli-keyboard-nav#readme
- Issues: https://github.com/timjcook/ember-cli-keyboard-nav/issues
- npm.io page: https://npm.io/package/ember-cli-keyboard-nav

## Dependencies (1)

- [ember-cli-babel](https://npm.io/package/ember-cli-babel.md) ^6.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-05-11
- 0.0.4 — 2017-06-16
- 0.0.3 — 2017-06-15
- 0.0.2 — 2017-06-15
- 0.0.1 — 2017-06-15

## README

# ember-cli-keyboard-nav

[![Build Status](https://travis-ci.org/timjcook/ember-cli-keyboard-nav.svg?branch=master)](https://travis-ci.org/timjcook/ember-cli-keyboard-nav)

A wrapper for binding a keyup event to a jQuery element and handling the actions with a simple interface.

## Installation

* `ember install ember-cli-keyboard-nav`

## Using the mixin

Add the mixin an Ember component by importing it with

```
import KeyboardNavMixin from 'ember-cli-keyboard-nav/mixins/keyboard-nav';
```

and applying the mixin to your component, eg.

```
export default Ember.Component.extend(KeyboardNavMixin, {
  ...
});
```

explicitly include it in your component's `didInsertElement` hook, passing in the jQuery object that you want to bind the keyboard actions to.

```
didInsertElement() {
  this.bindKeys($('input.my-input');
}
```

You can then override the following methods to handle different keyboard interactions

### onEnterPress

Handles a press of the `Enter` key.

### onEscPress

Handles a press of the `Esc` key.

### onUpPress

Handles a press of the `Up` key.

### onDownPress

Handles a press of the `Down` key.

### onCustomPress(keyNum)

Handles a press of any other key. Use the `keyNum` argument to find which key was pressed.

## License

This project is licensed under the [MIT License](LICENSE.md).

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