fix(DataGrid): paint header background past the column edges - #1926
Open
Stephen Watkins (stephenjwatkins) wants to merge 1 commit into
Open
fix(DataGrid): paint header background past the column edges#1926Stephen Watkins (stephenjwatkins) wants to merge 1 commit into
Stephen Watkins (stephenjwatkins) wants to merge 1 commit into
Conversation
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.
Stephen Watkins (stephenjwatkins)
marked this pull request as ready for review
September 4, 2026 16:04
Stephen Watkins (stephenjwatkins)
requested review from
a team
as code owners
September 4, 2026 16:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Changes
Fixes occasional DataGrid header seams.
Before:
After:
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.