Why is Vaading CustomLayout size not applied?

I have a CustomLayout [a table]
inside a CssLayout. The last column has a button that hides/display a child component inside the customlayout.

For some reason my table is overflowing the csslayout, when I click on the button. I look at the DOM and it seems some fixed width is being set on the TABLE element, which is larger than the parent CSSLayout, even though I have specified relative widths all the way up. Also when the page loads I see tables being resized several times. Looks like auto calculation is taking place.

Is this related to the general Vaddin layout issue or is there a special way to use CustomLayouts.

I was under the impression that if one uses CssLayout and CustomLayout than one can freely style them. But It seems that not to be the case. Even with these layouts the styles are not being honored.

Any help/pointers will be appreciated.

Code will help spot the problem.

Vaadin does handle the root element dimension when something else than undefined is specified to the components. So when you use relative sizes on CssLayout or CustomLayout, they receive pixel dimensions.

CustomLayout might even get fixed pixels when set to undefined size (set to the contained child element size), but I’m not sure ATM.