MudTable: Fix loading bar offset when the header row is missing or empty
Fixes #12182
.mud-table-sticky-header .mud-table-head .mud-table-loading pins the built-in progress row with a hard-coded top: $header-height-dense, independent of the header row's actual rendered height. With CustomHeader="true" and an empty HeaderContent the header has no height, so the loading bar is pushed 39px down into empty space instead of sitting flush against the top of the table.
This adds a top: 0 for the two shapes where there is no header row to sit under: the loading row is the first row, or the row above it renders no cells.
.mud-table-loading-row:first-child > .mud-table-loading,
tr:not(:has(> *)) + .mud-table-loading-row > .mud-table-loading {
top: 0;
}
Measured in Chrome as the loading bar's top minus the scroll container's top, at rest and at scrollTop = 120:
| table | shape | before | after |
|---|---|---|---|
| A | FixedHeader, CustomHeader, empty HeaderContent (the issue) | 39px | 0px |
| B | same but FixedHeader="false" (the thread's workaround) | 0px | 0px |
| D | FixedHeader with a real <MudTh> header (regression control) | 39px | 39px |
D stays pinned at 39px both at rest and while scrolling, so normal sticky-header behaviour is unchanged.
Before/After
Before
After