Skip to content

fix(material/badge): ensure overflow visible #24602

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
Mar 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/material/badge/_badge-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ $_badge-structure-emitted: false !default;
position: relative;
}

// The badge should make sure its host is overflow visible so that the badge content
// can be rendered outside of the element. Some components such as <mat-icon> explicitly
// style `overflow: hidden` so this requires extra specificity so that it does not
// depend on style load order.
.mat-badge.mat-badge {
overflow: visible;
Copy link
Member

Choose a reason for hiding this comment

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

Optional: should we just make this !important?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If so let's do it in another PR just because we want to get this in before the release goes out so the "next" version doesn't have broken icon badges, and I've got a TGP for this version of the fix. Technically this seems to be a good candidate for actually using important than its critical to the component working

}

.mat-badge-hidden {
.mat-badge-content {
display: none;
Expand Down