Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DataGrid] Fix right column group header border with virtualization #15470

Conversation

hendrikpeilke
Copy link
Contributor

@hendrikpeilke hendrikpeilke commented Nov 18, 2024

Fixes #15272

@mui-bot
Copy link

mui-bot commented Nov 18, 2024

Deploy preview: https://deploy-preview-15470--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 2189f5c

@hendrikpeilke
Copy link
Contributor Author

managed to go through the docs and tested it here: https://codesandbox.io/p/sandbox/mui-mui-x-x-data-grid-forked-sxvpym?workspaceId=87160672-f1b6-4335-8c56-44f4aa2c0a2f

The original problem is gone, but now there is a little shade left. I will go on discovery on that one tomorrow:
image

@KenanYusuf KenanYusuf added component: data grid This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels Nov 18, 2024
@hendrikpeilke
Copy link
Contributor Author

It's the seperator in the grid group header that is hanging there. I have no clue how I can get rid of that. From theory there probably hast to be something inside https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/components/columnHeaders/GridColumnGroupHeader.tsx like

if (!showRightBorder) { /* hide the right seperator */ }

But I need a clue, how to hide that best, since

columnHeaderSeparatorProps={{style: {visibility: "hidden"}}}

seems too dirty.

@KenanYusuf Do you have a clue? Or a material ui best practise?

@KenanYusuf
Copy link
Member

Thanks for picking this up @hendrikpeilke

The last column header in the column group should have a MuiDataGrid-columnHeader--last class on it, which when applied, hides the last separator. It looks like that isn't getting applied.

I haven't had a chance to look into it properly, but my guess would be that the value being passed to the isLastColumn prop is incorrect here: https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx#L459

That would be the first place to look. Will try and dig into it more tomorrow.

@KenanYusuf KenanYusuf added needs cherry-pick The PR should be cherry-picked to master after merge v7.x labels Nov 20, 2024
Copy link
Member

@KenanYusuf KenanYusuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should merge this given it fixes the original issue, and I will follow up with a fix for the problematic separator.

Thank you for your contribution 🏆

@KenanYusuf KenanYusuf enabled auto-merge (squash) November 20, 2024 09:56
@KenanYusuf KenanYusuf merged commit cdccf7d into mui:master Nov 20, 2024
16 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! needs cherry-pick The PR should be cherry-picked to master after merge v7.x
Projects
None yet
3 participants