Skip to content

Commit 76b532d

Browse files
devversionjosephperrott
authored andcommitted
fix(tabs): content animation in RTL not working (chrome) (#12215)
1 parent 95c762b commit 76b532d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/tabs/tabs-animations.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ export const matTabsAnimations: {
2222
translateTab: trigger('translateTab', [
2323
// Note: transitions to `none` instead of 0, because some browsers might blur the content.
2424
state('center, void, left-origin-center, right-origin-center', style({transform: 'none'})),
25-
state('left', style({transform: 'translate3d(-100%, 0, 0)'})),
26-
state('right', style({transform: 'translate3d(100%, 0, 0)'})),
25+
26+
// If the tab is either on the left or right, we additionally add a `min-height` of 1px
27+
// in order to ensure that the element has a height before its state changes. This is
28+
// necessary because Chrome does seem to skip the transition in RTL mode if the element does
29+
// not have a static height and is not rendered. See related issue: #9465
30+
state('left', style({transform: 'translate3d(-100%, 0, 0)', minHeight: '1px'})),
31+
state('right', style({transform: 'translate3d(100%, 0, 0)', minHeight: '1px'})),
32+
2733
transition('* => left, * => right, left => center, right => center',
2834
animate('500ms cubic-bezier(0.35, 0, 0.25, 1)')),
2935
transition('void => left-origin-center', [

0 commit comments

Comments
 (0)