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

[AvatarGroup] Fix misalignment with non-default spacing #31165

Merged
merged 1 commit into from Mar 1, 2022

Conversation

sjdemartini
Copy link
Contributor

@sjdemartini sjdemartini commented Feb 21, 2022

Closes #29641

The marginLeft style (applied only for custom spacing) should be applied on all but the last element of the group, in order to avoid misalignment of the Avatar children. This makes the non-default spacing (such as spacing="small" or spacing={10}) consistent with the behavior of the default spacing="medium" CSS, which leaves the margin-left as-is for the :last-child.

Before

Screen Shot 2022-02-21 at 10 57 07 AM

After

Screen Shot 2022-02-21 at 10 59 03 AM

(This demo uses default spacing, then spacing={10}, then spacing={-10}, then spacing="small".)

@mui-bot
Copy link

mui-bot commented Feb 21, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 9a772af

@danilo-leal danilo-leal added the component: avatar This is the name of the generic UI component, not the React module! label Feb 21, 2022
Copy link
Contributor

@danilo-leal danilo-leal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me!

@siriwatknp
Copy link
Member

@sjdemartini Thanks for the fix! Your provided image is all clear.

I put a hold on this because it is a breaking change. I think we should try to use the feature flag and be able to merge the breaking change.

@siriwatknp siriwatknp added breaking change on hold There is a blocker, we need to wait labels Feb 24, 2022
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sjdemartini
Copy link
Contributor Author

@siriwatknp sounds good, thanks! Is there anything I need to do as far as the feature flag, or is that something on your end?

@siriwatknp
Copy link
Member

@siriwatknp sounds good, thanks! Is there anything I need to do as far as the feature flag, or is that something on your end?

No worries, it is on our end to work on the feature flag or any approach that would help us merge the breaking change without waiting for the next version to happen.

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Feb 28, 2022
@siriwatknp
Copy link
Member

@siriwatknp sounds good, thanks! Is there anything I need to do as far as the feature flag, or is that something on your end?

We have concluded in our internal meeting that we will merge the breaking changes PR (mostly related to styles change) if it fixes a bug.

So, I am merging this one!

@siriwatknp siriwatknp removed the on hold There is a blocker, we need to wait label Mar 1, 2022
@siriwatknp siriwatknp merged commit 3f47a1c into mui:master Mar 1, 2022
@sjdemartini sjdemartini deleted the fix-avatar-group-misalignment branch March 1, 2022 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change bug 🐛 Something doesn't work component: avatar This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using spacing prop with AvatarGroup renders off-centered Avatars
5 participants