center a modal dialog on resize

UI Components for Angular
Post Reply
greghila
Posts: 5
Joined: 14 Sep 2016, 15:44

19 Sep 2016, 22:12

I need to center a modal dialog when is displayed and when windows is resized.

How can I achieve that?
Last edited by greghila on 26 Sep 2016, 18:37, edited 1 time in total.

greghila
Posts: 5
Joined: 14 Sep 2016, 15:44

26 Sep 2016, 17:05

I got some css

.ui-dialog {
width: 50%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(50%, -50%);
}

which does the trick but somehow when the window is resized, the dialog moves to the right side and stays there rather than staying on the center.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests