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

Always center dialog before reopen #2310

Closed
huineng opened this issue Mar 15, 2017 · 0 comments
Closed

Always center dialog before reopen #2310

huineng opened this issue Mar 15, 2017 · 0 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@huineng
Copy link

huineng commented Mar 15, 2017

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

Current behavior
dialog not centered

Expected behavior
call this.center();

What is the motivation / use case for changing the behavior?
I'm reusing the dialog to open various modals with different widths, center() is not being called

Please tell us about your environment:

  • Angular version: 2.4.0

  • PrimeNG version: 2.0.3

I'm reusing the p-dialog to display various content in various sizes, the p-dialog is not destroyed
content is dynamically changed

this works nicely except that for each "other then the first" the window is not centered
because of this in your code

if(!this.positionInitialized) {
            this.center();
            this.positionInitialized = true;
        }

This "this.positionInitialized" is updated only once and cannot be changed anymore
means if i reuse the component this values is never reset and thus the window is not centered

if it possible to either
turn positionInitialized into an @input public positionInitialized: boolean || false

or remove that line (not sure why it's there even )
or any other suggestion

thanks

@huineng huineng changed the title p-dialog nog re-centered after re-use as service p-dialog not re-centered after re-use as service Mar 26, 2017
@cagataycivici cagataycivici changed the title p-dialog not re-centered after re-use as service Always center dialog before reopen Apr 13, 2017
@cagataycivici cagataycivici self-assigned this Apr 13, 2017
@cagataycivici cagataycivici added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Apr 13, 2017
@cagataycivici cagataycivici added this to the 4.0.RC3 milestone Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants