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
set Content Dialog not centered #1712
Comments
Thanks for opening a new issue. The author has been notified and will review it as soon as possible. |
Please, create an example on codepen.io |
https://codepen.io/tommycorr/pen/bGwXYrz Open the dialog, and then resize your browser window. |
All ok for me |
You can use |
What version of Metro 4 you are use? Maybe you use not the latest version, and this version contains any bugs. |
I'm using 4.4.3. Do i use setPosition() before or after Metro.dialog.open('#dialog');?? and by default will it locate the dialog at the center?? |
You can call setPosition after setContent. Also setPosition executing automatically when window is resized. |
I added dialog.setPosition() after setContent and before open in the codepen i attached here, and no results. |
Check your browser console for errors |
No errors :( |
Ok, I understand your problem. Maybe this is a bug in the dialog positioning procedure. I will study this question. Thank you for your feedback. |
Thank you Olton, I'll be on the lookout |
Try this
|
That did the trick, thank you Olton! |
Since the content for the dialog contains Metro components, which are built after adding them to the DOM, it takes some time to calculate the height correctly. For static content, you don't need to use setTimeout. |
Noted, thank you for your support |
When I open a Dialog with setContent(), it loads onto the bottom of the screen.
When i minimize and maximize the browser or change browser window width or height, the dialog centers properly.
Is there a way to redraw or refresh dialog position before opening? or is there a solution??
Thank you
The text was updated successfully, but these errors were encountered: