Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Dialog Errors If No Focusable Element (Maximum call stack size exceeded) #15894

Closed
johnhwright opened this issue Jun 24, 2024 · 1 comment · Fixed by #15899 · 4 remaining pull requests
Closed

Dynamic Dialog Errors If No Focusable Element (Maximum call stack size exceeded) #15894

johnhwright opened this issue Jun 24, 2024 · 1 comment · Fixed by #15899 · 4 remaining pull requests
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working v18-port
Milestone

Comments

@johnhwright
Copy link

johnhwright commented Jun 24, 2024

Describe the bug

We use dynamic dialogs fairly aggressively in our applications and after the most recent update and now we get Maximum call stack size exceeded errors when opening certain ones:

image

I've traced this back to dialogs that don't have any focusable element on them at load (see the attached stackblitz). This can be worked around by setting config.focusOnShow = false; But we have hundreds of dialogs and having a focusable element isn't always even known until runtime. Would be great if this could be fixed so it doesn't explode if no element is found.

Seems related to #15263

Environment

n/a

Reproducer

https://stackblitz.com/edit/github-a35oyt?file=src%2Fapp%2Fapp.component.html

Angular version

17.3.11

PrimeNG version

17.18.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

n/a

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@johnhwright johnhwright added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 24, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 25, 2024
@mehmetcetin01140 mehmetcetin01140 self-assigned this Jun 25, 2024
@mehmetcetin01140 mehmetcetin01140 added this to the 17.18.2 milestone Jun 25, 2024
cetincakiroglu added a commit that referenced this issue Jun 27, 2024
Fixed #15894 - DynamicDialog | Dynamic Dialog Errors If No Focusable …
@shekhaua
Copy link

shekhaua commented Jul 4, 2024

The same issue happens in a normal dialog (primeng 17.18.2) component (p-dialog), if focusOnShow parameter is not set to false.
RangeError: Maximum call stack size exceeded
at Module.DomHandler (primeng-dialog.mjs:1152:1)
at Dialog.focus (primeng-dialog.mjs:423:25)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)
at Dialog.focus (primeng-dialog.mjs:438:18)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment