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

[List] Remove background inheritance of ListSubheader #25532

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/src/pages/components/lists/PinnedSubheaderList.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ export default function PinnedSubheaderList() {
position: 'relative',
overflow: 'auto',
maxHeight: 300,
'& > li': {
bgcolor: 'inherit',
'& > ul': { bgcolor: 'inherit', padding: 0 },
},
'& ul': { padding: 0 },
}}
subheader={<li />}
>
Expand Down
5 changes: 1 addition & 4 deletions docs/src/pages/components/lists/PinnedSubheaderList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ export default function PinnedSubheaderList() {
position: 'relative',
overflow: 'auto',
maxHeight: 300,
'& > li': {
bgcolor: 'inherit',
'& > ul': { bgcolor: 'inherit', padding: 0 },
},
'& ul': { padding: 0 },
}}
subheader={<li />}
>
Expand Down
5 changes: 2 additions & 3 deletions docs/src/pages/components/lists/lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ The switch is the secondary action and a separate target.

{{"demo": "pages/components/lists/SwitchListSecondary.js", "bg": true}}

## Pinned Subheader List
## Sticky subheader

Upon scrolling, subheaders remain pinned to the top of the screen until pushed off screen by the next subheader.

This feature relies on CSS sticky positioning.
Unfortunately it's [not implemented](https://caniuse.com/#search=sticky) by all the supported browsers. It defaults to `disableSticky` when not supported.
(⚠️ no IE 11 support)

{{"demo": "pages/components/lists/PinnedSubheaderList.js", "bg": true}}

Expand Down
8 changes: 4 additions & 4 deletions docs/src/pages/components/tables/tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ The `ActionsComponent` prop of the `TablePagination` component allows the implem

{{"demo": "pages/components/tables/CustomPaginationActionsTable.js", "bg": true}}

## Fixed header
## Sticky header

An example of a table with scrollable rows and fixed column headers.
It leverages the `stickyHeader` prop.<br />
(⚠️ no IE11 support)
Here is an example of a table with scrollable rows and fixed column headers.
It leverages the `stickyHeader` prop.
(⚠️ no IE 11 support)

{{"demo": "pages/components/tables/StickyHeadTable.js", "bg": true}}

Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/ListSubheader/ListSubheader.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const ListSubheaderRoot = experimentalStyled(
position: 'sticky',
top: 0,
zIndex: 1,
backgroundColor: 'inherit',
backgroundColor: theme.palette.background.paper,
}),
}));

Expand Down