material-table-core / core

Datatable for React based on material-ui's table with additional features. Support us at https://opencollective.com/material-table-core
https://material-table-core.github.io
MIT License
296 stars 146 forks source link

Table Header not colored correctly in dark theme #794

Closed TheGoodSpinach closed 1 year ago

TheGoodSpinach commented 1 year ago

Describe the bug With MUIv5, when switching to dark mode, the color table header of material-table does not match the rest of the table.

This seems to be the result of MUI changing the logic of how Paper background-color is calculated. It now consists of a background-image over a background-color. This means we cannot use theme.palette.background.paper directly, instead using background-color: transparent to inherit the paper background.

Please refer to the following sandbox: https://codesandbox.io/s/material-table-starter-template-forked-cllsk7?file=/src/index.js

I believe this may be caused by this line of code here:

https://github.com/material-table-core/core/blob/de5a8e18b25d4ebb990b1246febd5967f34daa10/src/components/MTableHeader/index.js#L570

It's possible changing this to backgroundColor: "transparent" (or even just removing this line) may fix this.

To Reproduce Steps to reproduce the behavior:

  1. Go to the sandbox link above
  2. Observer that table header is darker shade of black than the rest of the table

Expected behavior Table header background color matches rest of grid.

Screenshots image

Additional context Add any other context about the problem here.

Domino987 commented 1 year ago

Hi, thanks for this extensive issue. This looks indeed like something that should not be in the code there. Will be fixed with the next release.

TheGoodSpinach commented 1 year ago

Thanks a lot for the quick fix @Domino987 . Do you have a rough timeline when we can expect the next release?

Domino987 commented 1 year ago

I just did

TheGoodSpinach commented 1 year ago

Ah, I didn't see under the "Releases" section, only once I went to tags. Thank you!