Skip to content

Calling animation.next inside onloop callback is not working. #1838

@ScreamZ

Description

@ScreamZ

@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.

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.

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

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions