Skip to content

[data grid] Issue when styling virtualized column header row #18066

@wilcoschoneveld

Description

@wilcoschoneveld

Search keywords

data grid styling column header

Latest version

  • I have tested the latest version

Affected products

Data Grid

Steps to reproduce

Steps:

  1. Open this link to live example: https://codesandbox.io/p/devbox/data-grid-base-forked-qrp42k?workspaceId=ws_GSyKqZMEdPCJM8JwxJ5NKj
  2. Scroll horizontally very fast

Current behavior

CleanShot.2025-05-29.at.20.52.24.mp4

the header background color is not visible in the columnHeaders div

Expected behavior

CleanShot.2025-05-29.at.20.53.40.mp4

keep the header background color at all times

Context

I figured out that the issue is due to a style container--top [role=row] that sets the background to the background base, and this component is in between the columnHeaders div and the columnHeader divs. This basically negates the styling set on columnHeaders. Unsetting the background solves the issue as shown in the codesandbox

Image

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID: 96051

Metadata

Metadata

Assignees

Labels

customization: cssDesign CSS customizability.scope: data gridChanges related to the data grid.type: enhancementIt’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions