fix(core): animations no longer silently exits if the element is not apart of the DOM (#13763)
This commit is contained in:

committed by
Igor Minar

parent
889b48d85f
commit
21030e9a1c
@ -262,12 +262,11 @@ export class DomRenderer implements Renderer {
|
||||
element: any, startingStyles: AnimationStyles, keyframes: AnimationKeyframe[],
|
||||
duration: number, delay: number, easing: string,
|
||||
previousPlayers: AnimationPlayer[] = []): AnimationPlayer {
|
||||
try {
|
||||
if (this._rootRenderer.document.body.contains(element)) {
|
||||
return this._animationDriver.animate(
|
||||
element, startingStyles, keyframes, duration, delay, easing, previousPlayers);
|
||||
} catch (e) {
|
||||
return new NoOpAnimationPlayer();
|
||||
}
|
||||
return new NoOpAnimationPlayer();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user