-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Component: DynamicDialog not working with zonejs less application #16402
Comments
Same error here. Had to remove Zoneless support |
Hey, you can check my example. In this particular issue you can trigger change detection manually as a potential workaround for this issue :) |
Hi guys, I found another solution about this issue: Suppose to have a method that called this line of code: Inside the LoaderComponent inject the DynamicDialogConfig and implement the OnDestroy interface with the following line of code: This will clean and remove from the DOM the dialog in a proper way. This solution allows you to open a modal directly from an Angular Service, NgRx Signal Store, or other non-component contexts, where ChangeDetectorRef isn't accessible. |
Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨ |
@Trolejbus @Bock92 @cetincakiroglu the issue has been present and has been caused since the Angular 18.2.2 release and is unrelated to the mentioned PrimeNG 17.18.10 release. My zoneless PrimeNG application worked perfectly fine with PrimeNG 17.18.15 until I upgraded from Angular 18.2.0 to 18.2.13. I thoroughly tracked down the root cause of the bug, and it seems to be a change in the The change that causes this is an afterRender hook change in @angular/core, which is not even mentioned in the Angular 18.2.2 changelog: @alxhub could you please have a quick lock at PR #17123 if this is a proper fix after the Angular 18.2.2 afterRender hook change or is the "workaround" #16402 (comment) the proper way to clean things up? After this change even some Angular tests and the angular.dev website had to add an additional ref destroy call, the same as we did with the workaround in #16402 (comment), see: Related PRs: |
Describe the bug
I am not sure if PrimeNg lib is adapted to work with zonejs less Angular application (with provideExperimentalZonelessChangeDetection()), but if so than after closing dynamic dialog with overlay mask behind it, dialog is correctly closed, but overlay is not destroyed from html.
Environment
Windows/Chrome 128.0.6613.138
Reproducer
https://stackblitz.com/edit/stackblitz-starters-tpcpxh?file=src%2Fmain.ts
Angular version
18.0.2
PrimeNG version
17.18.10
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
v20.10.0
Browser(s)
Chrome 128.0.6613.138
Steps to reproduce the behavior
Uncommenting commented code fixes issue.
Expected behavior
Overlay should be destroyed after closing dialog.
The text was updated successfully, but these errors were encountered: