p-dialog [focusOnShow]="true" Maximum call stack size exceeded #15978
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
If I set the property [focusOnShow]="true" in the p-dialog component and the body of the dialog and the p-footer of the dialog do not contain a focusable element, it results in a "Maximum call stack size exceeded" error.
The problem is here
(https://github.com/primefaces/primeng/blob/e804cd63eeadcb6cede73aab108fdd167dc28d5f/src/app/components/dialog/dialog.ts#L601C5-L619C1) where this.focus(this.footerViewChild.nativeElement); is called infinitely.
Environment
Doesnt matter
Reproducer
https://github-seqmj3.stackblitz.io/
Angular version
17.3.11
PrimeNG version
17.18.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v18.20.3
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The component does not crash even if it does not have a focusable
Proposed Fix
The text was updated successfully, but these errors were encountered: