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

ConfirmDialog doesn't always re-center on browser resize #5834

Closed
mroskamp opened this issue Jun 1, 2018 · 3 comments
Closed

ConfirmDialog doesn't always re-center on browser resize #5834

mroskamp opened this issue Jun 1, 2018 · 3 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@mroskamp
Copy link
Contributor

mroskamp commented Jun 1, 2018

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")

[ X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

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

  1. Open confirmation dialog and notice how it's centered in the browser.
  2. Close the dialog
  3. Resize the browser, so it's substantially smaller in width
  4. Re-open the confirmation dialog. Notice how the dialog is not center and, perhaps, completely off the screen.

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

@filip12345678910
Copy link

The URL https://stackblitz.com/github/kkviqoxk doesn't work.

@mroskamp
Copy link
Contributor Author

mroskamp commented Jun 4, 2018

Fixed and I've updated the first post. This one should work: https://stackblitz.com/edit/github-nthu4h

@cagataycivici cagataycivici self-assigned this Jan 11, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 11, 2019
@cagataycivici cagataycivici added this to the 7.0.5 milestone Jan 11, 2019
@cagataycivici cagataycivici added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 11, 2019
@cagataycivici
Copy link
Member

Fixed via #7164

@cagataycivici cagataycivici removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

3 participants