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

Nested grids for v2 are not behaving the same as in v1 #43707

Open
1 task done
frekvent-szabolcs opened this issue Sep 11, 2024 · 1 comment · May be fixed by #43733
Open
1 task done

Nested grids for v2 are not behaving the same as in v1 #43707

frekvent-szabolcs opened this issue Sep 11, 2024 · 1 comment · May be fixed by #43733
Assignees
Labels
bug 🐛 Something doesn't work component: Grid The React component.

Comments

@frekvent-szabolcs
Copy link

frekvent-szabolcs commented Sep 11, 2024

Search keywords

grid

Latest version

  • I have tested the latest version

Steps to reproduce

Link to live example.

Current behavior

Nesting a Grid container inside a Grid (item) previously (using v1) worked like v2 works when I wrap the nested Grid container in a fragment. Is this broken or expected behaviour?

image

Also, when I nest a Grid container inside a Grid item, lot of times (even in my example), the CSS variables are not defined:
image

Expected behavior

No response

Context

After migrating to v6 from v5, following the Guide I migrated Grid v1 to v2. Many of my grids broke. I either had to specify widths for the inner Grids or just add fragments between the parent end children grids.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@frekvent-szabolcs frekvent-szabolcs added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 11, 2024
@oliviertassinari oliviertassinari added the component: Grid The React component. label Sep 11, 2024
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned siriwatknp Sep 11, 2024
@Janpot Janpot assigned Janpot and unassigned DiegoAndai Sep 12, 2024
@Janpot Janpot linked a pull request Sep 12, 2024 that will close this issue
@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 13, 2024
@Janpot
Copy link
Member

Janpot commented Sep 13, 2024

#43733 fixes this problem. See updated codesandbox.

Note that the behavior where nested grids inherit properties from the parent grid requires them to be direct children of the parent grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: Grid The React component.
Projects
Status: In progress
Development

Successfully merging a pull request may close this issue.

6 participants