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

MUI 6 support upgrade : Grid2 does not have a width of 100% by default #10482

Open
Revarh opened this issue Jan 29, 2025 · 2 comments
Open

MUI 6 support upgrade : Grid2 does not have a width of 100% by default #10482

Revarh opened this issue Jan 29, 2025 · 2 comments

Comments

@Revarh
Copy link

Revarh commented Jan 29, 2025

What you were expecting:
I am changing all my Grid components to MUI6 Grid2 and I should not see a change in appearance.

What happened instead:
The items' size is not taken into consideration. I realized that I need to add width="100%" to the Grid2 container to make it work. Has anyone had the same issue ?

Steps to reproduce:
Simply change all Grid components to Grid2, in a SimpleForm (regular or RBAC)

`



        <Grid2 size={6}>
          <TimeInput
            source="timeEnd"
            label="Fin du RDV"
            variant="outlined"
            fullWidth
          />
        </Grid2>
      </Grid2>

`

The other solution I found was to modify the component in the theme:

components: { MuiGrid2: { styleOverrides: { container: { width: '100%' }, }, }, },

Also, please note that ra-form-layout WizardToolbar uses the depreciated Grid instead of Grid2.

Environment

  • React-admin version: 5.5.2
  • Last version that did not exhibit the issue (if applicable): 4.16
  • React version: 18.3
  • Browser: Mozilla Firefox
  • Stack trace (in case of a JS error): no JS error
@slax57
Copy link
Contributor

slax57 commented Jan 29, 2025

Can you share a reproduction sandbox or stackblitz?

@slax57
Copy link
Contributor

slax57 commented Jan 29, 2025

I've tried to use Grid2 in the e-commerce demo but did not run into this issue. So we'll definitely need a repro. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants