diff --git a/src/app/components/autofocus/autofocus.ts b/src/app/components/autofocus/autofocus.ts index 9b218a7cc84..45fc91426a0 100644 --- a/src/app/components/autofocus/autofocus.ts +++ b/src/app/components/autofocus/autofocus.ts @@ -35,20 +35,18 @@ export class AutoFocus { } if (!this.focused) { - if (this.autofocus) { - this.focus(); - } + this.autoFocus(); } } ngAfterViewChecked() { if (!this.focused) { - this.focus(); + this.autoFocus(); } } - focus() { - if (isPlatformBrowser(this.platformId)) { + autoFocus() { + if (isPlatformBrowser(this.platformId) && this.autofocus) { setTimeout(() => { const focusableElements = DomHandler.getFocusableElements(this.host?.nativeElement);