Skip to content

Commit

Permalink
Merge pull request #15528 from primefaces/issue-15524
Browse files Browse the repository at this point in the history
Refactor on #15525
  • Loading branch information
cetincakiroglu authored May 10, 2024
2 parents 37a9103 + 6f2222b commit 31e6aa7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/app/components/autofocus/autofocus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 31e6aa7

Please sign in to comment.