Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2077x 2077x 2077x 1x 1x 1x 284x 284x 1x 1x 1x 528x 528x 1x 1x 926x 926x 1x | import { Directive, ElementRef, HostListener } from '@angular/core';
import { FocusScopeDirective } from './focus-scope.directive';
@Directive({
selector: '[data-gc-focus-target]',
standalone: false,
})
export class FocusTargetDirective {
constructor(
private el: ElementRef<unknown>,
private scope: FocusScopeDirective,
) {}
@HostListener('blur', ['$event'])
protected onBlur(event: FocusEvent): void {
this.scope.onTargetBlur(event);
}
@HostListener('focus', ['$event'])
protected onFocus(event: FocusEvent): void {
this.scope.onTargetFocus(event);
}
public isFocusTarget(nativeElement: unknown): boolean {
return this.el.nativeElement === nativeElement;
}
}
|