You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @archiecobbs, the issue you're seeing is caused by the use of em units in column widths. Because the font size on the header row is different from body rows, those sizes resolve to different pixel widths, thus misalignment.
As mention in the docs, you should use e.g. rem or px instead for column widths.
But bleh... this is yet another obscure Vaadin booby trap. I've fallen into so many over the years...
So I'll change this bug to be a feature request - to log a warning (only once of course) in this situation.
Thanks.
archiecobbs
changed the title
Grid column headers are not aligned with the columns themselves
Vaadin should log a warning when EM units are used in a Grid column header
Nov 29, 2024
Oh, and suggestions of how to remove said booby trap are always welcome. Preferably ones that avoid introducing breaking changes affecting existing applications.
Description
After loading and displaying a new
Grid
, the column headers are not aligned with the columns themselves.If you then grab one of the separators between the column headers and slide it left or right, the headers "snap" into their correct alignments.
Here's a video showing the problem:
VaadinBugVideo.mov
Expected outcome
The column headers should always be aligned with the columns themselves.
Minimal reproducible example
Please download and run this reproducer: https://github.com/archiecobbs/vaadin-grid-load-fail-issue/tree/column-alignment-issue
Note you have to checkout the column-alignment-issue branch.
Steps to reproduce
git clone [email protected]:archiecobbs/vaadin-grid-load-fail-issue.git
git checkout column-alignment-issue
tomcat@10
installed viabrew
mvn clean package
./run.sh
Environment
Vaadin version(s): 24.5.5
OS: MacOS 15.1.1
Browsers
Chrome
The text was updated successfully, but these errors were encountered: