Skip to content

Commit

Permalink
Merge pull request #15899 from primefaces/issue-15894
Browse files Browse the repository at this point in the history
Fixed #15894 - DynamicDialog | Dynamic Dialog Errors If No Focusable …
  • Loading branch information
cetincakiroglu authored Jun 27, 2024
2 parents ce0876d + 35d35e1 commit af07a58
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 af07a58

Please sign in to comment.