Skip to content

Commit

Permalink
fix(): fix angular autofocus directive
Browse files Browse the repository at this point in the history
  • Loading branch information
nobilo committed Oct 21, 2022
1 parent fbf2eb4 commit e36d9a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components-angular/src/focus.directive.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { AfterViewInit, Directive, ElementRef } from '@angular/core'
import { AfterViewChecked, Directive, ElementRef } from '@angular/core'

@Directive({
selector: 'balAutofocus',
selector: '[balAutoFocus]',
})
export class BalAutoFocus implements AfterViewInit {
export class BalAutoFocus implements AfterViewChecked {
constructor(private elementRef: ElementRef) {}

ngAfterViewInit() {
ngAfterViewChecked() {
this.elementRef.nativeElement.focus()
}
}

0 comments on commit e36d9a0

Please sign in to comment.