Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Grid DetailRow breaks Layout
Hello.
Given a HorizonalLayout with:
Label | Grid | Button
The Grid has 2 rows and DetailRows set and the Button hides/shows the Label.
If the DetailRow of the first row visible and I click the Button to hide the Label, the Grid disappears.
This does not happen if only the DetailRow of the second row is visible or none DetailRow is visible.
EDIT: this happens in 7.5.0 and 7.5.1
In 7.5.2 and 7.5.3 the Grid makes all detailRows invisible before the Label will be hidden.
Thus the Grid doesn't dissapear anymore.
Sample Code
HorizontalLayout hl = new HorizontalLayout();
hl.setSizeFull();
final Label leftLabel = new Label("leftLabel");
leftLabel.setSizeUndefined();
final Grid grid = new Grid();
Column col_a = grid.addColumn("a");
col_a.setMaximumWidth(100);
grid.addColumn("b");
grid.setSizeFull();
grid.setDetailsGenerator(new DetailsGenerator() {
@Override
public Component getDetails(final RowReference rowReference) {
return new Label(rowReference.getItem().toString());
}
});
grid.addItemClickListener(new ItemClickListener() {
@Override
public void itemClick(final ItemClickEvent event) {
grid.setDetailsVisible(event.getItemId(), !grid.isDetailsVisible(event.getItemId()));
}
});
grid.addRow("a1", "b1");
grid.addRow("a2", "b2");
Button hideButton = new Button("hide/show leftLabel");
hideButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(final ClickEvent event) {
leftLabel.setVisible(!leftLabel.isVisible());
}
});
hl.addComponent(leftLabel);
hl.addComponent(grid);
hl.addComponent(hideButton);
hl.setExpandRatio(grid, 1);
setContent(hl);