Skip to content

fix(badge): remove badge margins #11599

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

Merged
merged 1 commit into from
Jun 7, 2018

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented May 31, 2018

Removes the margins that are being added to an element that has a badge. Having the margin was problematic, because it can influence the user's layout and it doesn't handle toggling between a visible and hidden badge very well.

Fixes #11596.

@crisbeto crisbeto added the needs: discussion Further discussion with the team is needed before proceeding label May 31, 2018
@crisbeto crisbeto requested a review from amcdnl as a code owner May 31, 2018 11:35
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 31, 2018
@crisbeto
Copy link
Member Author

@jelbourn @amcdnl marking this as "needs discussion" since I can see it going two ways. On one hand, we don't want to take up the extra space if we don't have to, but on the other it means that toggling between a visible and a hidden badge will cause the element to shift. IMO the shifting isn't that big of an issue, because the badge is being removed at the same time. What do you think?

@jelbourn
Copy link
Member

Why does the badge affect layout at all?

@jelbourn jelbourn added the target: minor This PR is targeted for the next minor release label May 31, 2018
@crisbeto
Copy link
Member Author

crisbeto commented May 31, 2018

AFAIK the reasoning is that it makes some extra space so it doesn't overlap with the element next to it.

@jelbourn
Copy link
Member

jelbourn commented Jun 1, 2018

@amcdnl do you have any opinions? I'm leaning towards not removing the margin because I think it's worse for the UI to jump than to have the extra space.

@amcdnl
Copy link
Contributor

amcdnl commented Jun 3, 2018

@jelbourn - I'm on the fence. I agree the jumping is not ideal but a odd white space in text might be just as frustrating. If I had to choose, I'd probably say remove the whitespace.

@crisbeto crisbeto force-pushed the 11596/hidden-badge-margin branch from 47ef3ee to 54ca0ee Compare June 4, 2018 17:07
@crisbeto
Copy link
Member Author

crisbeto commented Jun 4, 2018

Removed the margins @jelbourn @amcdnl, PTAL. Also depending on how many screenshot failures we get, we might have to bump this to a major version.

@crisbeto crisbeto removed the needs: discussion Further discussion with the team is needed before proceeding label Jun 4, 2018
Removes the margins that are being added to an element that has a badge. Having the margin was problematic, because it can influence the user's layout and it doesn't handle toggling between a visible and hidden badge very well.

Fixes angular#11596.
@crisbeto crisbeto force-pushed the 11596/hidden-badge-margin branch from 54ca0ee to 18b8513 Compare June 4, 2018 17:09
@crisbeto crisbeto changed the title fix(badge): remove margin if badge is hidden fix(badge): remove badge margins Jun 4, 2018
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Jun 5, 2018
@jelbourn
Copy link
Member

jelbourn commented Jun 5, 2018

Caretaker note: we need to evaluate whether this change is minor or major based on how it affects google3

@andrewseguin
Copy link
Contributor

Change did not affect any internal tests - I'd be alright with this being minor

@andrewseguin andrewseguin merged commit f042068 into angular:master Jun 7, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Badge] Icon is not centered when matBadgeHidden="true"
5 participants