VerticalLayout expand ratio miscalculated when inner component has a captio

Hi,

Best described with code :slight_smile:

VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
        
TextField textField = new TextField("Input Text:");
Label label1 = new Label("LABEL 1");
Label label2 = new Label("LABEL 2");

layout.addComponent(textField);

layout.addComponent(label1);
layout.setExpandRatio(label1, 1.0f);

layout.addComponent(label2);

In this scenario the lowest label (label2) is pushed below the bottom of the layout.
I noticed that the expand DIV padding-top is miscalculated.
If the TextField does not have a caption, everything works correctly.
It also occurs only on Vaadin 7.1.13 and above.

Is it a bug or am I missing something?

Thanks,
Nadav

Hello Nadav,

Most likely a bug in Vaadin core. Opened a ticket for that
http://dev.vaadin.com/ticket/13741
Thank you for reporting this.

Best regards,
Matti