Skip to content

FluentDataGrid: pinned column offsets leak into the grid of an open RowDetails (master-detail) #5350

Description

@sebguischr

Setup: a FluentDataGrid with pinned columns (Pin="DataGridColumnPin.Start" / End) and RowDetails whose content is
another FluentDataGrid that also has pinned columns (master-detail).

Actual: once a detail is open, the pinned cells of the master grid are shifted by their own width (start column moved right,
end column moved left), and header cells of the nested grid overlap.

Cause: UpdatePinnedColumnOffsets (Components/DataGrid/FluentDataGrid.razor.js) uses
gridElement.querySelectorAll("th[col-pinned='start']") / 'end', which also returns the pinned headers of the nested grid, then
applyOffset writes the offset on every [col-index="N"] cell of the subtree — master and nested cells share col-index values.
The unpinned cells of the nested grid that share a col-index also receive inset-inline-* (visible on the sticky header row).

Suggested fix: only consider the grid's own header row and rows, e.g. gridElement.tHead.rows[0].cells and the cells of
gridElement.tHead.rows / gridElement.tBodies[n].rows instead of a subtree query.
(Workaround in our app: a MutationObserver that recomputes the offsets per table.)

Environment: Microsoft.FluentUI.AspNetCore.Components 5.0.0 / Microsoft.FluentUI.AspNetCore.McpServer 5.0.0, Blazor Server, net9.0, Chrome, Windows 11. Found while migrating an application from 4.14.4 to 5.0.0.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions