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

[docs] Update flex parent demo to set min height for overlays #14900

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
12 changes: 10 additions & 2 deletions docs/data/data-grid/layout/FlexGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default function FlexGrid() {
maxColumns: 6,
});

const rows = data.rows.slice(0, nbRows);

return (
<Box sx={{ width: '100%' }}>
<Stack direction="row" spacing={1} sx={{ mb: 1 }}>
Expand All @@ -26,8 +28,14 @@ export default function FlexGrid() {
Add a row
</Button>
</Stack>
<div style={{ display: 'flex', flexDirection: 'column' }}>
<DataGrid {...data} rows={data.rows.slice(0, nbRows)} loading={loading} />
<div
style={{
display: 'flex',
flexDirection: 'column',
minHeight: rows.length === 0 ? 200 : undefined,
Copy link
Member Author

Choose a reason for hiding this comment

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

Rationale: #14901 (comment)

}}
>
<DataGrid {...data} rows={rows} loading={loading} />
</div>
</Box>
);
Expand Down
12 changes: 10 additions & 2 deletions docs/data/data-grid/layout/FlexGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default function FlexGrid() {
maxColumns: 6,
});

const rows = data.rows.slice(0, nbRows);

return (
<Box sx={{ width: '100%' }}>
<Stack direction="row" spacing={1} sx={{ mb: 1 }}>
Expand All @@ -26,8 +28,14 @@ export default function FlexGrid() {
Add a row
</Button>
</Stack>
<div style={{ display: 'flex', flexDirection: 'column' }}>
<DataGrid {...data} rows={data.rows.slice(0, nbRows)} loading={loading} />
<div
style={{
display: 'flex',
flexDirection: 'column',
minHeight: rows.length === 0 ? 200 : undefined,
}}
>
<DataGrid {...data} rows={rows} loading={loading} />
</div>
</Box>
);
Expand Down
11 changes: 0 additions & 11 deletions docs/data/data-grid/layout/FlexGrid.tsx.preview

This file was deleted.

Loading