feat: update data-grid to use CSS subgrid. #172
Draft
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.
Pull Request
Description
This PR updates data grid to use CSS subgrid rather than flexbox on the grid and grid on the rows. This makes it easier to have column widths be consistent across the header row, if present, and regular rows in the grid because now they are all aligned to the same grid tracks rather than each row being a separate grid.
I ran into this issue of differing column widths while creating a grid that can have variable width content in the header cells (sortable columns where the sort arrow icons are hidden until the column is being sorted on) AND when trying to set the
grid-template-columns
on the parent data-grid tofit-content
. This resulted in the header cells being wider than the cells in the regular rows and is only made worse when the cells have left/right borders on them as the borders between cells in the header and the next row don't align vertically. With this change the rows now inherit theirgrid-template-columns
from their parent grid and made to span all the columns of the parent grid so any changes to column widths on the grid are matched on all of the rows consistently.CSS subgrid has support in all three major browser engines going back at least two versions so I am confident with making this change now.
Issues
microsoft/fast#6886
Reviewer Notes
Draft for now until microsoft/fast#6886 gets released in Foundation.
Test Plan
Checklist
General
Component-specific
⏭ Next Steps