I created an element (div.parent
) with an Angular animation that worked great. When I add a child element to it and try to animate the child at the same time, one of the animations doesn't end up running (it just snaps to the new state).
Stackblitz: https://stackblitz.com/edit/angular-2tbwu8
Markup:
<div [@theParentAnimation]="state" class="parent">
<div [@theChildAnimation]="state" class="child">
</div>
</div>
Animations:
trigger( 'theParentAnimation', [
state( 'down', style( {
transform: 'translateY( 100% ) translateZ( 0 )',
} ) ),
transition( '* <=> *', [
group( [
query( ':self', [
animate( '0.9s cubic-bezier(0.55, 0.31, 0.15, 0.93)' ),
] ),
query( '@theChildAnimation', animateChild() ),
] ),
] ),
] ),
trigger( 'theChildAnimation', [
state( 'down', style( {
transform: 'translateY( 100% ) translateZ( 0 )',
} ) ),
transition( '* <=> *', [
animate( '0.9s cubic-bezier(0.55, 0.31, 0.15, 0.93)' ),
] ),
] ),