fix(animations): ensure web-animations are caught within the Angular zone
Closes #11881 Closes #11712 Closes #12355 Closes #11881 Closes #12546 Closes #12707 Closes #12774
This commit is contained in:

committed by
Victor Berchet

parent
6e35d13fbc
commit
f80a157b65
@ -14,4 +14,6 @@ export interface DomAnimatePlayer {
|
||||
onfinish: Function;
|
||||
position: number;
|
||||
currentTime: number;
|
||||
addEventListener(eventName: string, handler: (event: any) => any): any;
|
||||
dispatchEvent(eventName: string): any;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export class WebAnimationsPlayer implements AnimationPlayer {
|
||||
|
||||
// this is required so that the player doesn't start to animate right away
|
||||
this._resetDomPlayerState();
|
||||
this._player.onfinish = () => this._onFinish();
|
||||
this._player.addEventListener('finish', () => this._onFinish());
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
@ -63,6 +63,8 @@ export class WebAnimationsPlayer implements AnimationPlayer {
|
||||
return <DomAnimatePlayer>element.animate(keyframes, options);
|
||||
}
|
||||
|
||||
get domPlayer() { return this._player; }
|
||||
|
||||
onStart(fn: () => void): void { this._onStartFns.push(fn); }
|
||||
|
||||
onDone(fn: () => void): void { this._onDoneFns.push(fn); }
|
||||
|
Reference in New Issue
Block a user