ConfirmDialog doesn't always re-center on browser resize #5834
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
If you have a PrimeNG PRO Support subscription please post your issue at;
https://pro.primefaces.org
where our team will respond within 4 business hours.
If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that
your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.
I'm submitting a ... (check one with "x")
Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-nthu4h
Current behavior
If I open a confirmation dialog and close it, then resize the browser window and re-open the confirmation dialog, the dialog doesn't re-center.
Expected behavior
The confirmation dialog should always be centered, regardless of whether the browser was resized while the dialog was open or closed.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
From my understanding, the confirmation dialog is meant to have a single instance, of which the contents can be swapped out for different contexts via the ConfirmationService. As such, the confirmation dialog has a long lifespan. Users should be able to resize their browser at any time and still expect to have their dialog centered.
Note that I've been able to work around this issue by manually setting
confirmDialog.positionInitialized = false;
in ngAfterViewChecked in the component that owns the the p-confirmDialog. This could be optimized by only resetting it before the dialog is shown or after the dialog is closed, but the events available in the ConfirmDialog and ConfirmationService are limited.Angular version: 5.2.10
PrimeNG version: 5.2.6
The text was updated successfully, but these errors were encountered: