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

[data grid] styling disappears on pinned columns in v7.0.0-beta.5 #12313

Closed
rajat-brunel opened this issue Mar 4, 2024 · 8 comments
Closed
Labels
component: data grid This is the name of the generic UI component, not the React module!

Comments

@rajat-brunel
Copy link

rajat-brunel commented Mar 4, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/inspiring-shadow-cprc2c?file=%2Fsrc%2FDemo.js%3A20%2C36

Steps:

  1. Followed the styling tutorial from here: https://next.mui.com/x/react-data-grid/style/#styling-rows
  2. Followed the pinned tutorial from here: https://next.mui.com/x/react-data-grid/column-pinning/
  3. Combined them and the styling disappears if a column is pinned and comes back on once it's unpinned.
  4. Works as intended on version 6.19.6

Current behavior

The styling for a row or a cell is disappearing if that specific column is pinned.

pinned-col-no-styling

Expected behavior

The styling for a row or a cell should still be applied if that specific column is pinned.

Context

No response

Your environment

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

Search keywords: component: data grid feature: column pinning
Order ID: 79393

@rajat-brunel rajat-brunel added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 4, 2024
@michelengelen
Copy link
Member

Hey @rajat-brunel could you please make the sandbox public? It seems to be private.

@michelengelen michelengelen added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 4, 2024
@michelengelen michelengelen changed the title Data Grid (PRO) styling disappears on pinned columns in v7.0.0-beta.5 [data grid] styling disappears on pinned columns in v7.0.0-beta.5 Mar 4, 2024
@rajat-brunel
Copy link
Author

Hey @rajat-brunel could you please make the sandbox public? It seems to be private.

Hi @michelengelen sorry yea, it's public now. Here is the link : https://codesandbox.io/p/sandbox/inspiring-shadow-cprc2c?file=%2Fsrc%2FDemo.js%3A20%2C36

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Mar 4, 2024
@michelengelen
Copy link
Member

Hey @rajat-brunel ... I have fiddled around a bit with our striped row example myself and here is what I came up with: striped rows with pinned columns

The change I did was simply targeting the cell classes and not the rows.

One thing though: There is still some leftover background on the pinned cells when hovering a row. This is due to a change in @next.

@romgrk the pinned columns cannot be styled anymore. This seems like a little regression. Could you check that please?

@michelengelen michelengelen added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 4, 2024
@rajat-brunel
Copy link
Author

Hey @rajat-brunel ... I have fiddled around a bit with our striped row example myself and here is what I came up with: striped rows with pinned columns

@michelengelen this link opens up the same code sandbox that's on the original post, Can you please post the one that you had changed ? Thank you.

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Mar 5, 2024
@romgrk
Copy link
Contributor

romgrk commented Mar 5, 2024

Here is a simplified example covering the default/hover cases, you can add the selected case following this model: https://codesandbox.io/p/sandbox/proud-rain-82w9pr?file=%2Fsrc%2FDemo.js%3A169%2C1

You need to set the background on the cells, not the rows. You also can't use transparent pinned cells, because there is content behind them. If you want a specific color, you need to blend it yourself or use color-mix().

@romgrk romgrk added status: waiting for author Issue with insufficient information and removed bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 5, 2024
@rajat-brunel
Copy link
Author

Ah okay, I see, I will set the colours on the cells not the row.
Thank you!

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Mar 7, 2024
@michelengelen
Copy link
Member

Hey @rajat-brunel ... I have fiddled around a bit with our striped row example myself and here is what I came up with: striped rows with pinned columns

@michelengelen this link opens up the same code sandbox that's on the original post, Can you please post the one that you had changed ? Thank you.

I am sry ... I did miss the notification for this. Thanks @romgrk for providing a solution ... mine was basically the same! :D

Great to see that we could be of help @rajat-brunel

@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 7, 2024
Copy link

github-actions bot commented Mar 7, 2024

⚠️ This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.

How did we do @rajat-brunel?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants