fix(animations): make sure style calculations are not computed too early (#15540)
Closes #15507
This commit is contained in:

committed by
Victor Berchet

parent
f368381d12
commit
a580f8c61f
@ -31,6 +31,7 @@ export class MockAnimationDriver implements AnimationDriver {
|
||||
export class MockAnimationPlayer extends NoopAnimationPlayer {
|
||||
private __finished = false;
|
||||
public previousStyles: {[key: string]: string | number} = {};
|
||||
private _onInitFns: (() => any)[] = [];
|
||||
|
||||
constructor(
|
||||
public element: any, public keyframes: {[key: string]: string | number}[],
|
||||
@ -45,6 +46,16 @@ export class MockAnimationPlayer extends NoopAnimationPlayer {
|
||||
});
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
onInit(fn: () => any) { this._onInitFns.push(fn); }
|
||||
|
||||
/* @internal */
|
||||
init() {
|
||||
super.init();
|
||||
this._onInitFns.forEach(fn => fn());
|
||||
this._onInitFns = [];
|
||||
}
|
||||
|
||||
finish(): void {
|
||||
super.finish();
|
||||
this.__finished = true;
|
||||
|
Reference in New Issue
Block a user