Skip to content

Commit

Permalink
fix(material/snack-bar): handle long single-line content (#24135)
Browse files Browse the repository at this point in the history
Fixes that long strings without spaces were breaking the layout of the snack bar.

Fixes #21681.

(cherry picked from commit 0bc45ca)
  • Loading branch information
crisbeto authored and andrewseguin committed Jan 13, 2022
1 parent 4972dc5 commit 99e7782
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/material/snack-bar/simple-snack-bar.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<span>{{data.message}}</span>
<span class="mat-simple-snack-bar-content">{{data.message}}</span>
<div class="mat-simple-snackbar-action" *ngIf="hasAction">
<button mat-button (click)="action()">{{data.action}}</button>
</div>
5 changes: 5 additions & 0 deletions src/material/snack-bar/simple-snack-bar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ $button-vertical-margin: -(math.div($button-height - $line-height, 2));
margin-right: $button-horizontal-margin;
}
}

.mat-simple-snack-bar-content {
overflow: hidden;
text-overflow: ellipsis;
}

0 comments on commit 99e7782

Please sign in to comment.