-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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-system][Grid] Remove disableEqualOverflow
by using gap
#42526
Conversation
Netlify deploy preview
@material-ui/core: parsed: -0.10% 😍, gzip: -0.15% 😍 Bundle size reportDetails of bundle changes (Toolpad) |
I like this direction, also keeping the APIs similar between the two Grid components sounds awesome 👌 We should document the breaking change if we decide to go with it! |
d3584eb
to
6223bad
Compare
6223bad
to
5e73ae9
Compare
disableEqualOverflow
from by using gap
disableEqualOverflow
by using gap
There are some style-breaking changes we should discuss. The previous approach of using a negative margin caused some artifacts that are now being fixed but will be perceived as breaking from users that have already adapted to the artifacts. These are reflected on the Argos failing tests so I'll group them and discuss them here: A. Grid is contained inside parent's paddingPreviusly, because of the negative margin, the Grid overflowed the parent's padding: Now, the Grid doesn't overflow: This is what removes the need for
But it also causes the scroll fix:
Here's the fixed demo: https://deploy-preview-42526--material-ui.netlify.app/material-ui/react-grid2/#disable-the-scrollbar B. Spacing is no longer considered inside the Grid's boxChanging from
IMO we should accept this change, as Remaining Argos failuresI'm not sure what caused these Argos failures:
But seems like the original implementation is overflowing, so this change looks like an improvement. Also don't know what happened with this one: https://app.argos-ci.com/mui/material-ui/builds/28714/93537251. It looks good in the preview: https://deploy-preview-42526--material-ui.netlify.app/joy-ui/react-aspect-ratio/#variants And the dashboard template is showing an error as well: https://app.argos-ci.com/mui/material-ui/builds/28714/93537202. But it looks ok in the preview: https://deploy-preview-42526--material-ui.netlify.app/material-ui/getting-started/templates/dashboard/ Types check failureThe types check failure is because I haven't yet removed the @mnajdova @siriwatknp @aarongarciah above is the breakdown of the breaking changes ☝🏼. I think we should accept these and document them as breaking changes, but I want to know if you're on board. I don't see a way of using If you're on board, I'll document the breaking changes and mark this PR for review. |
@DiegoAndai I think the changes make sense:
This maps better with how developers work with layout these days: flex/grid + gap 👌 Not sure if I'm missing additional issues in the thread that @siriwatknp linked, but it looks like all of it is covered in your explanation. |
Thanks for the detailed explanation. We can accept this breaking change because it is a part of the v6 goal, to transition to Pigment CSS 👏 |
@siriwatknp, this is ready for review 🙌🏼 I've added a section to the migration guide explaining the breaking changes: https://deploy-preview-42526--material-ui.netlify.app/material-ui/migration/migration-v5/#grid-v2-unstable-grid Please go through the Argos changes and review if everything makes sense to you or if something is wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the before/after images 👌
Co-authored-by: Danilo Leal <[email protected]> Signed-off-by: Diego Andai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of #35993
POC to refactor the Grid component using the
gap
CSS property. This removes the scroll bug thatdisableEqualOverflow
was used to solve. With the removal ofdisableEqualOverflow
, we can remove the use of context and move closer to a RSC compatible Grid.