flackr / scroll-timeline

A polyfill of ScrollTimeline.
Apache License 2.0
891 stars 84 forks source link

Don’t try ticking the animation if there are no details #186

Closed bramus closed 6 months ago

bramus commented 6 months ago

I believe this is a regression introduce by #89. When using the polyfill in Safari (which hash a BFCache), one would get errors about trying to read autoAlignStartTime from the details.

Narrowing things down and working my way up the call tree, the root cause is in tickAnimation which tries to get the details from the proxyAnimations. Since proxyAnimations gets cleared on pagehide, details can be empty, so the whole ticking stop stop if no details are present.

This PR fixes that.