-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
@dtex @rwaldron
Hello guys, hope you're well.
First issue
When using the Animation API there is no way out from onloop callback using animation.next
The next function is watch for isRunning === true and prevent going to next.
Lines 85 to 91 in 094bf6c
| next() { | |
| if (this.isRunning) { | |
| return this; | |
| } else { | |
| this.isRunning = true; | |
| } |
If we call pause right before, this is not working too because it doesn't turn running false.
Lines 125 to 138 in 094bf6c
| pause() { | |
| this.emit("animation:pause"); | |
| if (this.playLoop) { | |
| this.playLoop.stop(); | |
| } | |
| this.paused = true; | |
| if (this.onpause) { | |
| this.onpause(); | |
| } | |
| } |
if we call stop we clear the stack because this
Line 150 in 094bf6c
| this.segments = []; |
So we can't go to the next animation.
Only solution is to call stop and trigger a new animation from within the callback.
Second issue
oncomplete callback is not called for current animation when using stop(). But it only call onStop
Maybe we could think about something else ?