-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Animation improvements #23322
🐛 Animation improvements #23322
Conversation
So sorry about this, didn't think of it before I saw the AnimationTypedef reviewing this PR, but could you try simply passing the delay to the animation runner? I think it'd need more work than this commit, but could you look into how this simplifies your PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, one nit :))
@@ -283,13 +269,25 @@ class AnimationRunner { | |||
|
|||
/** Pauses the animation. */ | |||
pause() { | |||
// Animation hasn't started yet since it's waiting for a sequenced | |||
// animation. | |||
if (this.scheduledActivity_ !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given your comment, wouldn't this.scheduledWait_
be more accurate?
* animation improvements * fix types * welp... * use scheduleWait_ var instead
* animation improvements * fix types * welp... * use scheduleWait_ var instead
This PR introduces a number of fixes for animation bugs that we've had for a while related to hold-to-pause.
1: Console errors were showing up due to animations that hadn't started yet. This was due to the fact that we weren't checking if the animation was still waiting for another animation or had a delay.
2: When an animation with a delay was paused, it ignored the pausing and continued to animate. Fixes #23224
3: When an animation with a delay hadn't started yet, and the user navigated to another page and then came back, the delay wasn't being restarted, so it would appear right away on page landing.
To address these, I separated the
getStartWaitPromise_
and a newgetDelayWaitPromise_
that is only in charge of the delay. Each delay will get adelayId_
and adelayStartTime_
. With these, we are able to cancel and restart thedelay
for the corresponding animation.EDIT: the above paragraph's approach wasn't necessary. We only needed to include the delay in the animation keyframe definition (see latest commit).