Skip to content

fix(DataGrid): paint header background past the column edges - #1926

Open
Stephen Watkins (stephenjwatkins) wants to merge 1 commit into
mainfrom
fix/datagrid-header-column-seams
Open

fix(DataGrid): paint header background past the column edges#1926
Stephen Watkins (stephenjwatkins) wants to merge 1 commit into
mainfrom
fix/datagrid-header-column-seams

Conversation

@stephenjwatkins

@stephenjwatkins Stephen Watkins (stephenjwatkins) commented Sep 4, 2026

Copy link
Copy Markdown
Member

📝 Changes

Fixes occasional DataGrid header seams.

Before:

image

After:

image

Column header cells are laid out at fractional widths, so a shared edge between two of them lands mid-device-pixel. At a device pixel ratio that isn't a whole number, neither cell's background fully covers that pixel -- measured coverage is ~0.67 -- and the rows behind the sticky header show through as a hairline seam. Integer ratios never show it, which is why it appears intermittently while resizing: resizing sweeps the column edges through sub-pixel offsets.

Paint the background from a pseudo-element that bleeds 2px past both side edges instead of from the cell itself, so each boundary pixel is covered from both sides. The overlap is invisible because every cell in the row paints the same color and the bleed at the ends of the row is clipped by the grid's scroll container.

Verified over 336 width/ratio configurations on the reported story and across 6 DataGrid stories: 806 -> 0 and 714 -> 0 seam pixels, with no rendering change at integer ratios outside the grid's rounded corners.

Column header cells are laid out at fractional widths, so a shared edge
between two of them lands mid-device-pixel. At a device pixel ratio that
isn't a whole number, neither cell's background fully covers that pixel --
measured coverage is ~0.67 -- and the rows behind the sticky header show
through as a hairline seam. Integer ratios never show it, which is why it
appears intermittently while resizing: resizing sweeps the column edges
through sub-pixel offsets.

Paint the background from a pseudo-element that bleeds 2px past both side
edges instead of from the cell itself, so each boundary pixel is covered
from both sides. The overlap is invisible because every cell in the row
paints the same color and the bleed at the ends of the row is clipped by
the grid's scroll container.

Verified over 336 width/ratio configurations on the reported story and
across 6 DataGrid stories: 806 -> 0 and 714 -> 0 seam pixels, with no
rendering change at integer ratios outside the grid's rounded corners.
@stephenjwatkins
Stephen Watkins (stephenjwatkins) marked this pull request as ready for review September 4, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant