UNPKG

igniteui-webcomponents

Version:

Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.

33 lines 930 B
class KeyboardFocusRingController { get focused() { return this._isKeyboardFocused; } constructor(host) { this._isKeyboardFocused = false; this._host = host; host.addController(this); } hostConnected() { for (const event of KeyboardFocusRingController._events) { this._host.addEventListener(event, this, { passive: true }); } } hostDisconnected() { for (const event of KeyboardFocusRingController._events) { this._host.removeEventListener(event, this); } } handleEvent(event) { this._isKeyboardFocused = event.type === 'keyup'; this._host.requestUpdate(); } } KeyboardFocusRingController._events = [ 'keyup', 'focusout', 'pointerdown', ]; export function addKeyboardFocusRing(host) { return new KeyboardFocusRingController(host); } //# sourceMappingURL=focus-ring.js.map