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

Polyfill throws for older browsers not supporting getAnimations(). #159

Open
calinoracation opened this issue Sep 19, 2023 · 2 comments
Open

Comments

@calinoracation
Copy link
Contributor

calinoracation commented Sep 19, 2023

Another one we're seeing in the wild: c.target.getAnimations is not a function. I worked around it in my forked version by doing a check for it, but also just wrapped a try/catch around the entire animationstart event as we've hit issues on a few parts of it now for older browsers.

https://caniuse.com/?search=getAnimations

Chrome 83 and older
Safari 13 and older
Firefox 74 and older

@flackr
Copy link
Owner

flackr commented Sep 19, 2023

Without getAnimations the polyfill won't work for CSS scroll driven animations - but it should still work fine for those started with Element.animate. We can certainly add a workaround to avoid using getAnimations if not available.

@calinoracation
Copy link
Contributor Author

Yeah I think that's helpful to not throw, especially with it happening on animationstart. We have tons of small animations so it saturated our logs even with a small amount of traffic exposure. I think it not working for those CSS ones when not available is reasonable, and honestly the browser versions throwing the error are outside of our support window, so it's not the biggest deal, but others might run into it as well and for us the errors in bugsnag, etc would be pretty noisy.

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

2 participants