GridLayout resizes height on page reload

I have a simple GridLayout used for a footer area on my main window. They contain 4 Labels, with the top center being a HorDashLayout that contains a fixed Label (“Last sent to server”) and another Label that is updated as data is received by the application.

In the image below, the top is how it looks when the page is initially loaded. The div height is set to 15px for the top row. And this is how I would expect it to look.

But the bottom image is how it looks when I click the REFRESH/RELOAD on my browser. The div height is now set to 30px for the top row. (Ignore the left margin bar is just from my image capture and is not added; same for right side truncation). This makes it look like there’s a new row has been added, but that’s not the case, it’s just gotten twice as tall for some reason.

If I logoff, then log back in, the page will show with the top version of the image again, like all is okay.

What could be causing the layout to change from a refresh? The rest of the page seems to look fine, only this GridLayout section.

Any ideas on how I can resolve this? Thanks!

Not exactly sure how your layout looks based on this description (GridLayout that contains 4 Labels + HorDashLayout with rowspan=2 in col 1?). However it looks like the label in the center (or another one) wraps during rendering and the required height is incorrectly measured from the wrapped label (there is horizontal space so it shouldn’t wrap). It might help to ensure the labels are “undefined” wide (setWidth(null)), which will prevent them from wrapping. Otherwise I would try to remove the HorDashLayout and see if it has something to do with the problem.

Well, you were right. This is a bug of some sort in HorDashLayout. I was bit by the “made two changes” before testing when I shifted to a GridLayout AND HorDashLayout, then blamed it on the GridLayout. Of course, because it renders correctly on the initial load, I didn’t even know there was an issue for a some time after the code was written.

The Label.setSizeUndefined() and/or Label.setWidth(null) had no effect that I could tell.

But just by changing HorDashLayout back to a HorizontalLayout, the problem no longer occurs.

Thanks for the suggestions…