fix(animations): report correct totalTime value even during noOp animations (#22225)
This patch ensures that if the NoopAnimationsModule is used then it will correctly report the associated `totalTime` property within the emitted AnimationEvent instance when an animation event trigger is fired. BREAKING CHANGE: When animation is trigged within a disabled zone, the associated event (which an instance of AnimationEvent) will no longer report the totalTime as 0 (it will emit the actual time of the animation). To detect if an animation event is reporting a disabled animation then the `event.disabled` property can be used instead. PR Close #22225
This commit is contained in:

committed by
Victor Berchet

parent
884de18cba
commit
e1bf067090
@ -43,6 +43,7 @@ export declare abstract class AnimationBuilder {
|
||||
|
||||
/** @experimental */
|
||||
export interface AnimationEvent {
|
||||
disabled: boolean;
|
||||
element: any;
|
||||
fromState: string;
|
||||
phaseName: string;
|
||||
@ -199,8 +200,8 @@ export declare function keyframes(steps: AnimationStyleMetadata[]): AnimationKey
|
||||
/** @experimental */
|
||||
export declare class NoopAnimationPlayer implements AnimationPlayer {
|
||||
parentPlayer: AnimationPlayer | null;
|
||||
totalTime: number;
|
||||
constructor();
|
||||
readonly totalTime: number;
|
||||
constructor(duration?: number, delay?: number);
|
||||
destroy(): void;
|
||||
finish(): void;
|
||||
getPosition(): number;
|
||||
|
Reference in New Issue
Block a user