-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Grid2] Layout do not work the same way as Grid #44716
Comments
Yes, that's the point the building the Grid2. Based on your code, I think you are using the Grid incorrectly.
|
Thanks for the reply. I updated the sandbox with spacing for the position. I'm only using Grid for this because it is state on the MUI documentation :
Also, I'm thinking, if a layout like that is broken with Grid2, what else could break ? It is supposed to create multi dimensional layout, it should probably not be broken like that on a still simple layout |
Hey @LoicMartinez! Thanks for the report. You're missing the export default function NewGrid() {
return (
<div>
<Grid2 container direction="row" spacing={4}>
<Grid2 container direction="column" size={6} spacing={1}>
- <Grid2 container direction="row" spacing={1}}>
+ <Grid2 container direction="row" spacing={1} size={12}>
<Grid2 size={6}>
<MultipleSelect />
</Grid2>
<Grid2 size={6}>
<MultipleSelect />
By adding If you're interested, I would suggest refactoring your code to be closer to our Grid2 demos. Instead of using direction 'row'|'column' and nesting Grid components, You could have one container like this demo: https://mui.com/material-ui/react-grid2/#basic-grid. This is the recommended way of using the Grid |
Thanks for the help, it fixed my issue ! I'm gonna get ride of the direction props if it should not be used anymore for nested grid like this one ! |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @LoicMartinez How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Steps to reproduce
Steps:
Current behavior
No response
Expected behavior
No response
Context
The layout i'm using here may simplified (i could use one column grid and two row grid) but it need to be that way, there are a lot of style i did not include to be as simple as possible
Your environment
No response
Search keywords: Grid2 layout, Grid2, Grid
The text was updated successfully, but these errors were encountered: