Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/data/material/components/menus/GroupedMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import { styled } from '@mui/material/styles';

const StyledListHeader = styled(ListSubheader)({
backgroundImage: 'var(--Paper-overlay)',
});
const StyledListHeader = Object.assign(
styled(ListSubheader)({
backgroundImage: 'var(--Paper-overlay)',
}),
{
// IMPORTANT: this property is needed to prevent the component from being focused
// when navigating with the keyboard, as ListSubheader is not a focusable element.
// For example, ListSubheader has it set to true by default, so does Divider.
Comment thread
silviuaavram marked this conversation as resolved.
Outdated
muiSkipListHighlight: true,
},
);

export default function GroupedMenu() {
const [anchorEl, setAnchorEl] = React.useState(null);
Expand Down
14 changes: 11 additions & 3 deletions docs/data/material/components/menus/GroupedMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
import { styled } from '@mui/material/styles';

const StyledListHeader = styled(ListSubheader)({
backgroundImage: 'var(--Paper-overlay)',
});
const StyledListHeader = Object.assign(
styled(ListSubheader)({
backgroundImage: 'var(--Paper-overlay)',
}),
{
// IMPORTANT: this property is needed to prevent the component from being focused
// when navigating with the keyboard, as ListSubheader is not a focusable element.
// For example, ListSubheader has it set to true by default, so does Divider.
Comment thread
silviuaavram marked this conversation as resolved.
Outdated
muiSkipListHighlight: true,
},
);

export default function GroupedMenu() {
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
Expand Down
Loading