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

Animation oncancel is triggered for new animations when using web-animations-next on Firefox #213

Open
cristinecula opened this issue Aug 2, 2019 · 0 comments

Comments

@cristinecula
Copy link

When using web-animations-next, the behavior of the Animation constructor is altered. On Firefox the oncancel event handler is triggered immediately after new Animation. This does not occur on Chrome or when using native web animations or the basic web-animations polyfill.

Reproduction:
https://gist.github.com/cristinecula/d47e8b20bbd5727c0aca0805dae75b10

Native and basic polyfill versions for comparison:
https://gist.github.com/cristinecula/274f5c2da0b82f0f5022df793eeced12
https://gist.github.com/cristinecula/5887c17250bd91b83227f8c1048f2417

I worked around this issue using this code:

    animation.oncancel = event => {
      if(animation.playState === 'running') return;
      console.log('oncancel', animation.playState)
    }

https://gist.github.com/cristinecula/72b41ad4e5ad2985bc04956ba9eba1ac

@cristinecula cristinecula changed the title Animation oncancel is triggered for new animations on web-animations-next on Firefox Animation oncancel is triggered for new animations when using web-animations-next on Firefox Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant