diff options
author | Zhe Sun <31067185+ZheSun88@users.noreply.github.com> | 2019-06-06 08:45:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-06 08:45:02 +0300 |
commit | e80358a39130face6eeeccf68a6c81782a710105 (patch) | |
tree | 46c0326992816c663583f22b094edd4907201475 /client | |
parent | 81277c29711c4821df76be9067588a3dfd93a7db (diff) | |
download | vaadin-framework-e80358a39130face6eeeccf68a6c81782a710105.tar.gz vaadin-framework-e80358a39130face6eeeccf68a6c81782a710105.zip |
Recalculate the column widths before the first row is added (#11609)
* Recalculate the column widths before the first row is added
Fixes #11607
Diffstat (limited to 'client')
-rwxr-xr-x | client/src/main/java/com/vaadin/client/widgets/Grid.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index ae63749c5f..4c88879ad1 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -7220,6 +7220,14 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, } if (newSize > oldSize) { + if (oldSize == 0 && !isHeaderVisible()) { + // Fixes framework/issues/11607 + // Need to recalculate column widths when the + // first row is added to a non-header grid, + // otherwise the checkbox will be aligned in a + // wrong place. + recalculateColumnWidths(); + } body.insertRows(oldSize, newSize - oldSize); cellFocusHandler.rowsAddedToBody(Range .withLength(oldSize, newSize - oldSize)); |