How adjust the Vaadin components' vertical alignment in a HorizontalLayout?

Viewed 199

I want to align the Button on the same line as the Text Fields. The item alignment has been set to Alignment.CENTER, but as you can see from the image, the vertical centers of the TextFields are lower due to the label on top of them.

    HorizontalLayout horizontalLayout = new HorizontalLayout();
    horizontalLayout.setAlignItems(FlexComponent.Alignment.CENTER);
    Div div = new Div(buttonAddPriceRange);
    horizontalLayout.add(spanneVon, spanneBis, div);

enter image description here

2 Answers

Try ...

horizontalLayout.setAlignItems(FlexComponent.Alignment.BASELINE);

Related