-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Grid] add equal spacing on sides of grid #30333
Conversation
@kutnickclose Hi. Thanks for opening the PR. While I confirmed in here that this change fixes the issue, I am afraid this introduces a breaking change. This means that this solution can only be included in our next alpha release, which is quite far away. |
This change seems to effectively be the opposite of #24332 by @greguintow. Won't we introduce the same regressions? |
Hey @oliviertassinari , I'll test the use cases and see if cause the issues I fixed. Thaaanks for tagging me |
@oliviertassinari @kutnickclose Please check the demo As you can see in there, the width is still right in the nested grid but it adds the x scrollbar because is bigger than viewport width. That's an issue I also faced when doing this which was why I had to use a negative margin to make it work as expected |
I'm still using negative margin as well, just more equally spread out rather than all on the top and left. Could the demo be fixed with instructions from v4 about negative margin? - https://v4.mui.com/components/grid/#negative-margin. |
Just an update on my end that my issue was related to a v4 MuiGrid class interacting with a v5 Grid component. This would add the old v4 style (padding/margin all the way around) + the the extra padding from the v5 style (padding/margin only on the top and left). This would end up leaving extra padding on the right and bottom. For example, my div related to the grid component might have I ended up namespacing the material ui v4 code and no longer have grid issues with v5. I think this PR can be closed. |
@kutnickclose Thank you for the update. I will close this PR :) |
I reopened this pull request, because it is indeed a regression from #24332 In grid docs, there is a section that briefly describes the issue when using
However, applying We can either improve the docs or try to come up with another solution. What do you think? @oliviertassinari |
👋 The migration PR has been merged. Please follow these steps to make sure that the contents are all updated. (Sorry for the inconvenience)
If you are struggle with the steps above, feel free to tag @siriwatknp |
Hi, I'd like to ask about the status of this PR. Can you give me an estimated time when it will be merged? If you need any help - either with review or with docs, let me know. |
@mui/core This might be a very good use case for adding a feature flag for enabling the fix. |
@siriwatknp I agree, I've seen this popped up in multiple issues, and for some is blocking the upgrade to v5. I propose we try adding a feature flag for it. cc @michaldudak for thoughts |
Yeah, we could go this way. Or we can explore what @siriwatknp proposed in #32057 (comment) and have a new version of the Grid in System, then deprecate the one in Material UI. The imports may be problematic, though (we will have to change the name of the new Grid when reexporting in from Material UI). |
Sounds like a plan, we don't have to reexport in v5 though. v5 v6 |
@siriwatknp If this is being captures in the new version of the |
Yes, the new grid (system) uses the same behavior as v4 (equal spacing on all sides). I think we can close this in favor of #32746 |
Fixes #29266
I confirmed this fixes the issue I was seeing in my application. I would love feedback on how to get this across the finish line.