mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-23 04:49:59 +00:00
17 lines
391 B
TypeScript
17 lines
391 B
TypeScript
import { Directive, AfterViewInit, ElementRef } from '@angular/core'
|
|
|
|
/** @hidden */
|
|
@Directive({
|
|
selector: '[autofocus]',
|
|
})
|
|
export class AutofocusDirective implements AfterViewInit {
|
|
constructor (private el: ElementRef) { }
|
|
|
|
ngAfterViewInit (): void {
|
|
this.el.nativeElement.blur()
|
|
setTimeout(() => {
|
|
this.el.nativeElement.focus()
|
|
})
|
|
}
|
|
}
|