Skip to content
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

Disable effect without cancelling animation #179

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/proxy-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,16 @@ function tickAnimation(timelineTime) {
const details = proxyAnimations.get(this);
if (timelineTime == null) {
// While the timeline is inactive, it's effect should not be applied.
// To polyfill this behavior, we cancel the underlying animation.
if (details.animation.playState != 'idle')
details.animation.cancel();
// To polyfill this behavior, we remove the underlying effect from animation and store it
if (details.animation.effect) {
details.tempEffect = details.animation.effect;
details.animation.effect = null;
}
return;
} else if (details.animation.effect === null && details.tempEffect) {
// Restore effect if it previously was removed due to an inactive timeline
details.animation.effect = details.tempEffect;
details.tempEffect = null;
}

if (details.pendingTask) {
Expand Down