Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/vaadin-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@
this.addEventListener('animationend', this._onAnimationEnd);
}

connectedCallback() {
super.connectedCallback();
requestAnimationFrame(() => {
if (this._recalculateColumnWidthOnceLoadingFinished) {
this.recalculateColumnWidths();
}
});
}

__hasRowsWithClientHeight() {
return !!Array.from(this.$.items.children).filter(row => row.clientHeight).length;
}
Expand Down
3 changes: 2 additions & 1 deletion test/column-auto-width.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
);
});
};

grid._recalculateColumnWidths.called = false;
whenColumnWidthsCalculated(() => {
expectColumnWidthsToBeOk(columns);
done();
Expand All @@ -106,6 +106,7 @@
requestAnimationFrame(() => {
grid.hidden = false;

grid._recalculateColumnWidths.called = false;
whenColumnWidthsCalculated(() => {
expectColumnWidthsToBeOk(columns);
done();
Expand Down