Skip to content

Commit 99e7782

Browse files
crisbetoandrewseguin
authored andcommitted
fix(material/snack-bar): handle long single-line content (#24135)
Fixes that long strings without spaces were breaking the layout of the snack bar. Fixes #21681. (cherry picked from commit 0bc45ca)
1 parent 4972dc5 commit 99e7782

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<span>{{data.message}}</span>
1+
<span class="mat-simple-snack-bar-content">{{data.message}}</span>
22
<div class="mat-simple-snackbar-action" *ngIf="hasAction">
33
<button mat-button (click)="action()">{{data.action}}</button>
44
</div>

src/material/snack-bar/simple-snack-bar.scss

+5
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ $button-vertical-margin: -(math.div($button-height - $line-height, 2));
3030
margin-right: $button-horizontal-margin;
3131
}
3232
}
33+
34+
.mat-simple-snack-bar-content {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}

0 commit comments

Comments
 (0)