Re: PopupPanel.center() not centering content?
Getting the size of the added content should be enough to trigger a reflow so the dimensions are OK and so is the positionning.
It might be that browsers have changed their strategies wrt hidden content (visibility:hidden, not display:none, which is expected to not have dimensions)
-- At least that's the explanation for why GWT does what it does.
Are you experiencing this in more than one browser? which one(s)?
On Tuesday, March 19, 2013 3:45:29 PM UTC+1, Ed wrote:
On Tuesday, March 19, 2013 3:45:29 PM UTC+1, Ed wrote:
What is the correct way to center content as a popup in the middle of the page?I am asking this because if I use GWT PopupPanel.center() method, it will not correctly center it's content, however the top left corner will be in the center of the page ;)..If however, I overrridde the PopupPanel.center() method, such that it performs first the show() action and then the center code in a Deferred Command, it will be correctly centered.I think this is because of the dimensions that are correctly calculated by the browser at the end current call stack (when it's attached to the root panel), such that you have to center it in the deferred command...Is this so?What is the correct way to center something in the middle of the page?And why does GWT not center the content in a deferred way?I prefer not to use the deferred way as in the past it gave me some problems when in the meantime something happens, like the content was removed/changed such that you have to build all kind of guards to check this :(...- Ed
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home