Hi folks, great lib.
I don't think this should work since this feature is undocumented but i would like the 'finished' promise of timelines to be triggered after the last tween is completed, now the promise is resolved after the first tween.
I had this issue, too. If your timeline only contains one animation, it works as expected. If the timeline contains multiple animations, the finished promise gets fired instantly, not after the first animation ends.
A workaround for this issue is setting delay and offset accordingly, see https://codepen.io/anon/pen/oWzxmb.
I also solved this by wrapping the timeline in a Promise and set the resolve call to the complete callback of the last tween. I would like to see this feature fixed / implemented because it would be very handy.
Looks like a bug.
Thanks for reporting it.
i had the same bug too with the current version
+1
Hacky thing to grease the wheels till it's solved, I suspect it's very similar to what @luglio7 did;
function whatever() {
let p1 = new Promise((resolve, reject) => {
animation = anime.timeline().add({
//stuff
}).add({
//etc
complete: () => resolve()
});
});
animation.finished = p1;
return animation;
}
exactly the same :)
I'm experiencing this bug on version 3.0, I have a timeline with several animations and the promise fires inmediately.
Hey thanks for reporting this issue, should be fixed in 3.0.1 !
@juliangarnier It works! Thank you, great work!
Most helpful comment
Hey thanks for reporting this issue, should be fixed in 3.0.1 !