Interactions

Focus

Normalizes the focus event across different browsers and devices.

Import

Import the Focus primitives from ng-primitives/interactions.

import { NgpFocus } from 'ng-primitives/interactions';

Usage

Assemble the focus directives in your template.

<div (ngpFocus)="onFocusChange($event)"></div>

API Reference

The following directives are available to import from the ng-primitives/interactions package:

NgpFocus

  • Selector: [ngpFocus]
  • Exported As: ngpFocus
Whether listening for focus events is disabled. Event emitted when the focus state changes.

Data Attributes

The following data attributes are applied to the ngpFocus directive:

Attribute Description Value
data-focus Whether the element is focused. true | false

Copyright © 2024 Angular Primitives