From 93da67f4e725e8cfacb4c46221ca726e87ee305b Mon Sep 17 00:00:00 2001 From: kubedan Date: Mon, 8 Jul 2024 13:54:15 +0200 Subject: [PATCH] Fixed #15978 - Doesn't call this.focus infinitely. --- src/app/components/dialog/dialog.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/dialog/dialog.ts b/src/app/components/dialog/dialog.ts index 93918923200..ec7f6952f59 100755 --- a/src/app/components/dialog/dialog.ts +++ b/src/app/components/dialog/dialog.ts @@ -611,7 +611,7 @@ export class Dialog implements AfterContentInit, OnInit, OnDestroy { this.zone.runOutsideAngular(() => { setTimeout(() => focusableElement.focus(), 5); }); - } else if (this.footerViewChild) { + } else if (this.footerViewChild && focusParentElement !== this.footerViewChild.nativeElement) { // If the content section is empty try to focus on footer this.focus(this.footerViewChild.nativeElement); }