From 0d1211003f8245ba3415745f02ea6e721f1a93be Mon Sep 17 00:00:00 2001 From: Domino987 Date: Wed, 4 Oct 2023 14:10:40 +0200 Subject: [PATCH] fix for tableheader dark mode (#795) Co-authored-by: Domino987 --- __tests__/demo/demo.js | 227 +++++++++++++++------------ src/components/MTableHeader/index.js | 3 +- 2 files changed, 126 insertions(+), 104 deletions(-) diff --git a/__tests__/demo/demo.js b/__tests__/demo/demo.js index 0dbdbc8a..f281eda8 100644 --- a/__tests__/demo/demo.js +++ b/__tests__/demo/demo.js @@ -53,116 +53,139 @@ import { } from './demo-components'; import { createRoot } from 'react-dom/client'; import { I1353, I1941, I122 } from './demo-components/RemoteData'; +import { Switch, FormControlLabel, CssBaseline } from '@mui/material'; module.hot.accept(); const container = document.querySelector('#app'); const root = createRoot(container); // createRoot(container!) if you use TypeScript -root.render( - - - -

DetailPanelRemounting

- - {/*

Switcher

- -

SelectionOnRowClick

- +function Demo() { + const [darkMode, setMode] = React.useState(false); + return ( + + + + + { + setMode(e.target.checked); + }} + /> + } + label="Dark Mode" + /> -

EventTargetErrorOnRowClick

- console.log('onSelectionChange', d)} - /> +

DetailPanelRemounting

+ + {/*

Switcher

+ -

DetailPanelIssuesProgrammaticallyHidingWhenOpen

- +

SelectionOnRowClick

+ -

Basic

- +

EventTargetErrorOnRowClick

+ console.log('onSelectionChange', d)} + /> -

Basic Ref

- +

DetailPanelIssuesProgrammaticallyHidingWhenOpen

+ - {/* -

Export Data

- - */} - {/* -

Custom Export

- - */} -

Bulk Edit

- -

Default Order Issue

- -

Bulk Edit With Detail Panel

- -

Hiding Columns

- -

TestingNewActionHandlersProp

- -

Editable Rows

- -

One Detail Panel

- -

Multiple Detail Panels

- -

Editable

- -

Frankenstein

- -

Resizable Columns

- -

Persistent Groupings

- -

Persistent Groupings Same ID

- -

Persistent Groupings unshared

- -

Tree data

- -

Table with Summary Row

- -

- Table with custom numbers of pages around current page in stepped - navigation -

- -

Fixed Column with Row Edits

- -

Localization with Custom Components

- -

Remote Data Related

-
    -
  1. -

    - mbrn{' '} - - #1353 - -

    - -
  2. -
  3. -

    - mbrn{' '} - - #1941 - -

    - -
  4. -
  5. -

    - - #122 - -

    - -
  6. -
-
-
-
-); +

Basic

+ + +

Basic Ref

+ + + {/* +

Export Data

+ + */} + {/* +

Custom Export

+ + */} +

Bulk Edit

+ +

Default Order Issue

+ +

Bulk Edit With Detail Panel

+ +

Hiding Columns

+ +

TestingNewActionHandlersProp

+ +

Editable Rows

+ +

One Detail Panel

+ +

Multiple Detail Panels

+ +

Editable

+ +

Frankenstein

+ +

Resizable Columns

+ +

Persistent Groupings

+ +

Persistent Groupings Same ID

+ +

Persistent Groupings unshared

+ +

Tree data

+ +

Table with Summary Row

+ +

+ Table with custom numbers of pages around current page in stepped + navigation +

+ +

Fixed Column with Row Edits

+ +

Localization with Custom Components

+ +

Remote Data Related

+
    +
  1. +

    + mbrn{' '} + + #1353 + +

    + +
  2. +
  3. +

    + mbrn{' '} + + #1941 + +

    + +
  4. +
  5. +

    + + #122 + +

    + +
  6. +
+
+
+
+ ); +} +root.render(); diff --git a/src/components/MTableHeader/index.js b/src/components/MTableHeader/index.js index 37fb7930..4414b34f 100644 --- a/src/components/MTableHeader/index.js +++ b/src/components/MTableHeader/index.js @@ -566,8 +566,7 @@ export const styles = { header: { // display: 'inline-block', // position: 'sticky', - top: 0, - backgroundColor: 'background.paper' // Change according to theme, + top: 0 }, headerWrap: (alignRight) => ({ display: 'flex',