p-confirmPopup errors when setTimeout runs after onContainerDestroy #13761
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
This is a follow-up issue from #13034.
In the p-confirmPopup, there are a few listeners that get set up in a setTimeout that gets called when the popup is first opened. If, for some reason, that setTimeout does not get called before the popup is closed, which sets
this.confirmation = null
on the component, the component throws a bunch of errors in places where it is expectingthis.confirmation
to be defined.In this case,
onAnimationStart()
callsalign()
, which accessesthis.confirmation?.target
and expects it to be defined.Environment
Versions below
Reproducer
No response
Angular version
16.2.1
PrimeNG version
16.0.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.14.0
Browser(s)
Chrome and Firefox, didn't test the others
Steps to reproduce the behavior
I was unable to reproduce this in a stackblitz, but I can reproduce in our app consistently. What happens is as follows:
DomHandler.absolutePosition()
, which is called from thealign()
method in the confirm popup component, becausethis.confirmation
is null.Expected behavior
No response
The text was updated successfully, but these errors were encountered: