# @riot-material/focus-manager

> You can install it via nodejs ```sh npm install @riot-material/focus-manager ``` or download one of the bundled file ```js /** * `dist/index.amd.js` * `dist/index.umd.js` */ requirejs.config({ paths: { "@riot-material/focus-manager":

Latest version **1.2.0** (published 2021-10-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @riot-material/focus-manager
pnpm add @riot-material/focus-manager
yarn add @riot-material/focus-manager
bun add @riot-material/focus-manager
```

## 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.2.0 |
| Published | 2021-10-01 |
| First published | 2020-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Kal Aster |
| Maintainers | elitexxl97 |

## Links

- npm: https://www.npmjs.com/package/@riot-material/focus-manager
- npm.io page: https://npm.io/package/@riot-material/focus-manager

## Recent versions

- 1.2.0 (latest) — 2021-10-01
- 1.1.0 — 2021-07-23
- 1.0.2 — 2020-11-29
- 1.0.1 — 2020-11-28
- 1.0.0 — 2020-11-28

## README

# focus manager for [riot-material](https://github.com/riot-material/riot-material)
## Installation
You can install it via nodejs
```sh
npm install @riot-material/focus-manager
```
or download one of the bundled file
```js
/**
 * `dist/index.amd.js`
 * `dist/index.umd.js`
 */
requirejs.config({
  paths: {
    "@riot-material/focus-manager": "path/to/@riot-material/focus-manager",
  },
});

require(['@riot-material/focus-manager'], function (focusManager) {
    // ...
});

/**
 * `dist/index.js`
 */
import * as focusManager from "@riot-material/focus-manager";

// or

import { ... } from "@riot-material/focus-manager";
```
otherwise you can include the script in your project html
```html
<script src="@riot-material/focus-manager/index.umd.js" />
```
and access it via
```js
window.riotMaterial.focusManager;
```
## Methods
### `hold(options?: `[`IOptions`](#ioptions)`): void`
### `release(): void`
### `on<T extends keyof `[`IManageableEvent`](#imanageableevent)`>(type: T, listener: (event: HTMLElementEventMap[T]) => void): void
## Interfaces
### `IOptions`
`element?: HTMLElement`
`onFocusInside?: (element: Element) => boolean`
if returns `true` the focus is kept to the element and hold back when it blurs away
`onFocusOutside?: (element: Element) => boolean`
if returns `true` the focus-manager is `release`d
`onPrevious?: () => void`
`onNext?: () => void`
### `IManageableEvent`
`"keydown": KeyboardEvent`
`"keyup": KeyboardEvent`

---
_Source: https://npm.io/package/@riot-material/focus-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
