Skip to content

[docs] Fix Data Grid advanced list view demo#17064

Merged
kenanyusuf merged 1 commit intomui:masterfrom
kenanyusuf:fix-list-view-demo
Mar 21, 2025
Merged

[docs] Fix Data Grid advanced list view demo#17064
kenanyusuf merged 1 commit intomui:masterfrom
kenanyusuf:fix-list-view-demo

Conversation

@kenanyusuf
Copy link
Copy Markdown
Member

@kenanyusuf kenanyusuf commented Mar 21, 2025

Use the window prop that gets passed to iframe demos instead of a ref on the container element.

Fixes #17056

Before

https://next.mui.com/x/react-data-grid/list-view/#advanced-usage

list-view.mp4

After

https://deploy-preview-17064--material-ui-x.netlify.app/x/react-data-grid/list-view/#advanced-usage

Screen.Recording.2025-03-21.at.09.14.23.mov

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 21, 2025

Thanks for adding a type label to the PR! 👍

@kenanyusuf kenanyusuf 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 Mar 21, 2025
@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 21, 2025

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

Generated by 🚫 dangerJS against 3b8d782

export default function ListViewAdvanced({ window }) {
// This is used only for the example - renders the drawer inside the container
const containerRef = React.useRef(null);
const container = () => containerRef.current;
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.

This was returning null when the drawer opened, meaning it did not have a container to render to.

@kenanyusuf kenanyusuf requested a review from a team March 21, 2025 09:15
@kenanyusuf kenanyusuf merged commit 077fef1 into mui:master Mar 21, 2025
27 of 28 checks passed
@kenanyusuf kenanyusuf deleted the fix-list-view-demo branch March 21, 2025 09:37
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] Data Grid advanced list view demo is broken

3 participants