Skip to content

Commit

Permalink
Fixed #15894 - DynamicDialog | Dynamic Dialog Errors If No Focusable …
Browse files Browse the repository at this point in the history
…Element (Maximum call stack size exceeded)
  • Loading branch information
mehmetcetin01140 committed Jun 25, 2024
1 parent 1a7c2cf commit 35d35e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/components/dynamicdialog/dynamicdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,12 @@ export class DynamicDialogComponent implements AfterViewInit, OnDestroy {
}

focus(focusParentElement = this.contentViewChild.nativeElement) {
const focusableElements = DomHandler.getFocusableElements(focusParentElement);

if (!focusableElements.length) {
return;
}

let focusable = DomHandler.getFocusableElement(focusParentElement, '[autofocus]');
if (focusable) {
this.zone.runOutsideAngular(() => {
Expand Down

0 comments on commit 35d35e1

Please sign in to comment.