Skip to content

Commit a516806

Browse files
committed
fix(material/tabs): glitchy animation in rtl with lazy-loaded content (#31535)
When the tabs have lazy-loaded content, their height can be zero to begin with. This appeared to hit a Chrome bug where animating the `transform` on a zero-height element in RTL was interrupting the animation. These changes fix the bug by setting a minimum height. Fixes #31503. (cherry picked from commit 892c281)
1 parent ced4165 commit a516806

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/material/tabs/tab-body.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@
3535
visibility: visible;
3636
}
3737

38+
// Chrome appears to have a bug where the animation glitches in RTL if the element
39+
// has a height of 0px which can happen with lazy-loaded content or when it's off-screen.
40+
// See: https://github.com/angular/components/issues/31503. We can work around it by setting
41+
// a minimum height on it.
42+
.mat-tab-body-animating > & {
43+
min-height: 1px;
44+
}
45+
3846
.mat-mdc-tab-group-dynamic-height & {
3947
overflow: hidden;
4048
}

0 commit comments

Comments
 (0)