2.0.1 • Published 3 years ago

@terminus/ui-autofocus v2.0.1

Weekly downloads
32
License
MIT
Repository
github
Last release
3 years ago

CI/CD Status Codecov MIT License
NPM version Library size

A directive that gives focus to an element on load.

Table of Contents

Installation

Use the ng add command to quickly install all the needed dependencies:

ng add @terminus/ui-autofocus

Usage

The tsAutofocus directive can be used on any element that has a .focus() method. This includes inputs, select menus, textarea, buttons, links, iframes and any element with a defined tabindex above -1.

Add the directive to a focusable element:

<input type="text" tsAutofocus />

Binding

Passing in any value except false, 'false', null, or undefined will enable the directive.

<!-- enabled -->
<input type="text" [tsAutofocus]="myProperty" />
<input type="text" [tsAutofocus]="true" />
<input type="text" tsAutofocus="" />

<!-- disabled -->
<input type="text" [tsAutofocus]="false" />
<input type="text" [tsAutofocus]="null" />
2.0.1

3 years ago

2.0.0

3 years ago

1.1.5

3 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago