Grid: Column resizing bug. Columns size+positions wrong after visibility ch


Columns size+positions wrong after visibility change:

When making a table invisible and visible again, colums change position and resize, pushing content out of bounds or partly hide content. Minimum sizes are not respected.

Preparation (
see attached project
):
Create a Layout that contains a grid, have the grid switched visible(true) and visible(false) on button click.
The grid shall have one column that grows and some columns that have either a fixed minimum size or have “setMinimumWidthFromContent(true)” set.

button.addClickListener(this::toggleVisibility);
grid.setHeaderVisible(false); // doesn't matter
grid.setFooterVisible(false); // doesn't matter
grid.addColumn(Model::iconHtml).setMinimumWidthFromContent(true).setResizable(false).setRenderer(new HtmlRenderer());
grid.addColumn(Model::name).setWidth(200).setResizable(false);
grid.addColumn(Model::remark).setExpandRatio(1); //important
grid.addComponentColumn(this::createDownButton).setMinimumWidthFromContent(true).setResizable(false);
grid.addComponentColumn(this::createUpButton).setMinimumWidthFromContent(true).setResizable(false);
grid.setFrozenColumnCount(5); // doesn't matter

Reproduction:
On first view the grid is sized properly.
Switch grid invisible and visible again.

Expected: Grid contents are fully visibl like before
Got: Grid columns are moved and resized, not respecting content sizes. Content is partly invisible.

Severity: High.
Workaround: fix all column sizes with predetermined values.

I have tried wrapping the grid in panes or layouts to no avail.
37303.zip (94.8 KB)

Yes, I think this is a known issue. This bug report I think is manifestation of the same issue in other context.

https://github.com/vaadin/framework/issues/9819