diff --git a/src/app/components/dynamicdialog/dynamicdialog.ts b/src/app/components/dynamicdialog/dynamicdialog.ts index 378ab0c535c..2af67bda442 100755 --- a/src/app/components/dynamicdialog/dynamicdialog.ts +++ b/src/app/components/dynamicdialog/dynamicdialog.ts @@ -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(() => {