2.0.1 • Published 4 years ago

@terminus/ui-autofocus v2.0.1

Weekly downloads
32
License
MIT
Repository
github
Last release
4 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

4 years ago

2.0.0

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.1

5 years ago

1.1.2

5 years ago

1.1.0

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago