Skip to content

Commit

Permalink
fix: Avoid sub-pixel rendering causing too narrow auto-width columns (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki authored Jun 8, 2020
1 parent 8a00c51 commit 211dae4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vaadin-grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,9 @@
col._currentWidth = 0;
// Note: _allCells only contains cells which are currently rendered in DOM
col._allCells.forEach(c => {
col._currentWidth = Math.max(col._currentWidth, c.offsetWidth);
// Add 1px buffer to the offset width to avoid too narrow columns (sub-pixel rendering)
const cellWidth = c.offsetWidth + 1;
col._currentWidth = Math.max(col._currentWidth, cellWidth);
});
});
// [write] Set column widths to fit widest measured content
Expand Down

0 comments on commit 211dae4

Please sign in to comment.