Skip to content

[data grid] Fix Demo CustomColumnMenuGrid crashing#22897

Merged
sai6855 merged 2 commits into
mui:masterfrom
sai6855:grid-menulist
Jun 22, 2026
Merged

[data grid] Fix Demo CustomColumnMenuGrid crashing#22897
sai6855 merged 2 commits into
mui:masterfrom
sai6855:grid-menulist

Conversation

@sai6855

@sai6855 sai6855 commented Jun 22, 2026

Copy link
Copy Markdown
Member

closes #22887

@sai6855 sai6855 added type: bug It doesn't behave as expected. docs Improvements or additions to the documentation. scope: data grid Changes related to the data grid. labels Jun 22, 2026
@sai6855 sai6855 marked this pull request as ready for review June 22, 2026 06:47
Copilot AI review requested due to automatic review settings June 22, 2026 06:47
@code-infra-dashboard

code-infra-dashboard Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy preview

https://deploy-preview-22897--material-ui-x.netlify.app/

Bundle size

Bundle Parsed size Gzip size
@mui/x-data-grid 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-pro 0B(0.00%) 0B(0.00%)
@mui/x-data-grid-premium 0B(0.00%) 0B(0.00%)
@mui/x-charts 0B(0.00%) 0B(0.00%)
@mui/x-charts-pro 0B(0.00%) 0B(0.00%)
@mui/x-charts-premium 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers 0B(0.00%) 0B(0.00%)
@mui/x-date-pickers-pro 0B(0.00%) 0B(0.00%)
@mui/x-tree-view 0B(0.00%) 0B(0.00%)
@mui/x-tree-view-pro 0B(0.00%) 0B(0.00%)
@mui/x-license 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the Data Grid docs demo CustomColumnMenuGrid crashing when opening the column menu (issue #22887) by updating the custom menu layout to use MUI menu list primitives instead of generic layout components.

Changes:

  • Replace Stack wrappers with MenuList in the custom column menu demo layout.
  • Apply the same structural update to both the TypeScript demo source and its transpiled JavaScript counterpart.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/data/data-grid/column-menu/CustomColumnMenuGrid.tsx Switches the custom column menu demo sections from Stack to MenuList.
docs/data/data-grid/column-menu/CustomColumnMenuGrid.js Mirrors the demo change in the transpiled JS file (should be regenerated from TSX).
Comments suppressed due to low confidence (1)

docs/data/data-grid/column-menu/CustomColumnMenuGrid.tsx:15

  • MenuList renders a <ul>, so placing a MUI Button (renders a <button>) directly inside it produces invalid markup (ul > button) and breaks expected menu semantics. Convert the close action to a MenuItem (which renders a <li role="menuitem">) so it is a valid child of MenuList.
import MenuList from '@mui/material/MenuList';
import Button from '@mui/material/Button';
import Divider from '@mui/material/Divider';

function MenuCloseComponent(props: GridColumnMenuItemProps) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

} from '@mui/x-data-grid';
import { useDemoData } from '@mui/x-data-grid-generator';
import Stack from '@mui/material/Stack';
import MenuList from '@mui/material/MenuList';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sai6855 did you run the docs generator script? If yes we can simply ignore this comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Or else I guess CI would flag it

} from '@mui/x-data-grid';
import { useDemoData } from '@mui/x-data-grid-generator';
import Stack from '@mui/material/Stack';
import MenuList from '@mui/material/MenuList';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sai6855 did you run the docs generator script? If yes we can simply ignore this comment.

@sai6855 sai6855 merged commit 0d92e3e into mui:master Jun 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation. scope: data grid Changes related to the data grid. type: bug It doesn't behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] Demo CustomColumnMenuGrid crashes

3 participants