From 4d51b837dc38b6279f1cbcac3b971bcfec52562f Mon Sep 17 00:00:00 2001 From: kn0wn Date: Tue, 7 Apr 2020 15:48:54 +0100 Subject: [PATCH] fix: blinking issue when reversing animation (fixes: #623, #586, #503, #577) --- documentation/index.html | 5 ++++- src/index.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/documentation/index.html b/documentation/index.html index 94a5e7aa..180115ac 100644 --- a/documentation/index.html +++ b/documentation/index.html @@ -2687,7 +2687,10 @@

Reverse

easing: 'easeInOutSine' }); -document.querySelector('.reverse-anim-demo .reverse').onclick = animation.reverse; +document.querySelector('.reverse-anim-demo .reverse').onclick = () => { + animation.reverse(); + animation.play(); +} /*DEMO*/ } diff --git a/src/index.js b/src/index.js index e90d050d..27d959c4 100644 --- a/src/index.js +++ b/src/index.js @@ -1115,6 +1115,7 @@ function anime(params = {}) { instance.reverse = function() { toggleInstanceDirection(); + instance.completed = instance.reversed ? false : true; resetTime(); }