fix(animations): only pass in same typed players as previous players into web-animations (#12907)
Closes #12907
This commit is contained in:

committed by
Victor Berchet

parent
7c36e7f956
commit
be010a292a
@ -54,6 +54,9 @@ export class WebAnimationsDriver implements AnimationDriver {
|
||||
playerOptions['easing'] = easing;
|
||||
}
|
||||
|
||||
// there may be a chance a NoOp player is returned depending
|
||||
// on when the previous animation was cancelled
|
||||
previousPlayers = previousPlayers.filter(filterWebAnimationPlayerFn);
|
||||
return new WebAnimationsPlayer(
|
||||
element, formattedSteps, playerOptions, <WebAnimationsPlayer[]>previousPlayers);
|
||||
}
|
||||
@ -71,3 +74,7 @@ function _populateStyles(styles: AnimationStyles, defaultStyles: {[key: string]:
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
function filterWebAnimationPlayerFn(player: AnimationPlayer) {
|
||||
return player instanceof WebAnimationsPlayer;
|
||||
}
|
||||
|
Reference in New Issue
Block a user