Skip to content

Commit d50b9f2

Browse files
jelbournvivian-hu-zz
authored andcommitted
Revert "fix(dialog,bottom-sheet): enter animation blocking child animations (#13888)" (#14017)
This reverts commit 235add9. This change broke an app inside of Google where tabs appear inside of a dialog. The tabs get stuck in a weird frozen animation state.
1 parent 4508fa1 commit d50b9f2

File tree

3 files changed

+9
-35
lines changed

3 files changed

+9
-35
lines changed

src/cdk-experimental/dialog/dialog-container.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {
10-
animate,
11-
AnimationEvent,
12-
state,
13-
style,
14-
transition,
15-
trigger,
16-
group,
17-
query,
18-
animateChild,
19-
} from '@angular/animations';
9+
import {animate, AnimationEvent, state, style, transition, trigger} from '@angular/animations';
2010
import {FocusTrapFactory} from '@angular/cdk/a11y';
2111
import {
2212
BasePortalOutlet,
@@ -64,13 +54,9 @@ export function throwDialogContentAlreadyAttachedError() {
6454
changeDetection: ChangeDetectionStrategy.Default,
6555
animations: [
6656
trigger('dialog', [
67-
state('enter', style({opacity: 1})),
68-
state('exit, void', style({opacity: 0})),
69-
transition('* => *', group([
70-
// `animateChild` allows for child component to animate at the same time. See #13870.
71-
query('@*', animateChild(), {optional: true}),
72-
animate(225),
73-
])),
57+
state('enter', style({ opacity: 1 })),
58+
state('exit, void', style({ opacity: 0 })),
59+
transition('* => *', animate(225)),
7460
])
7561
],
7662
host: {

src/lib/bottom-sheet/bottom-sheet-animations.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import {
1212
transition,
1313
trigger,
1414
AnimationTriggerMetadata,
15-
group,
16-
query,
17-
animateChild,
1815
} from '@angular/animations';
1916
import {AnimationCurves, AnimationDurations} from '@angular/material/core';
2017

@@ -28,10 +25,7 @@ export const matBottomSheetAnimations: {
2825
state('visible', style({transform: 'translateY(0%)'})),
2926
transition('visible => void, visible => hidden',
3027
animate(`${AnimationDurations.COMPLEX} ${AnimationCurves.ACCELERATION_CURVE}`)),
31-
transition('void => visible', group([
32-
// `animateChild` allows for child component to animate at the same time. See #13870.
33-
query('@*', animateChild(), {optional: true}),
34-
animate(`${AnimationDurations.EXITING} ${AnimationCurves.DECELERATION_CURVE}`),
35-
]))
28+
transition('void => visible',
29+
animate(`${AnimationDurations.EXITING} ${AnimationCurves.DECELERATION_CURVE}`)),
3630
])
3731
};

src/lib/dialog/dialog-animations.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import {
1212
transition,
1313
trigger,
1414
AnimationTriggerMetadata,
15-
query,
16-
animateChild,
17-
group,
1815
} from '@angular/animations';
1916

2017
const animationBody = [
@@ -23,13 +20,10 @@ const animationBody = [
2320
// decimate the animation performance. Leaving it as `none` solves both issues.
2421
state('void, exit', style({opacity: 0, transform: 'scale(0.7)'})),
2522
state('enter', style({transform: 'none'})),
26-
transition('* => enter', group([
27-
// `animateChild` allows for child component to animate at the same time. See #13870.
28-
query('@*', animateChild(), {optional: true}),
29-
animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({transform: 'none', opacity: 1})),
30-
])),
23+
transition('* => enter', animate('150ms cubic-bezier(0, 0, 0.2, 1)',
24+
style({transform: 'none', opacity: 1}))),
3125
transition('* => void, * => exit',
32-
animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({opacity: 0}))),
26+
animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({opacity: 0}))),
3327
];
3428

3529
/**

0 commit comments

Comments
 (0)