@riot-material/focus-manager
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

focus manager for riot-material

Installation

You can install it via nodejs

npm install @riot-material/focus-manager

or download one of the bundled file

/**
 * `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

<script src="@riot-material/focus-manager/index.umd.js" />

and access it via

window.riotMaterial.focusManager;

Methods

hold(options?: IOptions): void

release(): void

on<T extends keyof 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 released onPrevious?: () => void onNext?: () => void

IManageableEvent

"keydown": KeyboardEvent "keyup": KeyboardEvent

Readme

Keywords

none

Package Sidebar

Install

npm i @riot-material/focus-manager

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

31.4 kB

Total Files

11

Last publish

Collaborators

  • kal-aster