Unstable_Grid2 (MUI 5) vs Grid2 (MUI 6) - Gap implementation #44394
Labels
component: Grid
The React component.
support: question
Community support but can be turned into an improvement
Hi folks,
I'm writing about Grid2 and a difference found between the implementation on MUI 5 (Unstable_Grid2) and the implementation on MUI 6 (Grid2).
We own a license of MUI X Premium (Order ID: 97630), hope you can answer to this question.
MUI 6 (https://mui.com/material-ui/react-grid2/#how-it-works)
MUI 5 (https://v5.mui.com/material-ui/react-grid2/#how-it-works)
I'm using Grid2 in an application with a complex form (a wizard with around 180 fields).
The form is data-driven in the sense that each field is defined in the database and is associated with rules that determine whether it is active, mandatory, deactivated, ...
For each field, display options are also defined, including for example the space used (Grid2 size property) and if a line break before / after it is required.
The front end ask the back end for the list of fields (graphql), iterates on the fields list and renders each field.
The problem I have is related to the line break implemented through the following GridBreak component:
Example:
This solution works well in MUI 5, but has a problem with MUI 6 due to the fact that the new implementation use gap property in grid container.
Is it possible to opt in for MUI 5 gap implementation?
Is there a way to avoid this problem (setting negative margin to equals to GridBreak doesn't work)?
Many thanks in advance for your help and for such great library.
Mauro
Search keywords:
The text was updated successfully, but these errors were encountered: