Skip to content

Commit 7646db7

Browse files
committed
fix(material/snack-bar): add max height for snack bar
Adds a max height for the snack bar in case users pass huge strings into it. Fixes #31996.
1 parent 74060b1 commit 7646db7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ $fallbacks: m3-snack-bar.get-tokens();
3030
}
3131

3232
.mat-mdc-snack-bar-container {
33-
display: flex;
34-
align-items: center;
35-
justify-content: center;
3633
box-sizing: border-box;
3734
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
3835
margin: 8px;
3936

37+
// Note: ideally we would put this on the label,
38+
// but it ends up breaking somewhat breaking internally.
39+
max-height: 50vh;
40+
overflow: auto;
41+
4042
.mat-mdc-snack-bar-handset & {
4143
width: 100vw;
4244
}

0 commit comments

Comments
 (0)