metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.5k stars 604 forks source link

autoplay continues in safari when slideshow is outside of viewport #1298

Open pirco opened 5 months ago

pirco commented 5 months ago

I have a wraparound flickity slideshow with adaptiveHeight and autoPlay enabled.

on Chrome, when I scroll past the slideshow (with slideshow now outside/above the viewport), the slideshow stops autoscrolling (expected). but on Safari (mac, Version 17.2.1 (19617.1.17.11.12)), the slideshow continues to autoplay, causing the content below the slideshow (the content that is visible in the viewport of the browser) to shift up and down to accommodate the adaptive height of the slideshow. how can I stop the slideshow from playing in safari when it's not in the viewport?

Test case: https://codepen.io/pirco/pen/bGZZyWw

https://github.com/metafizzy/flickity/assets/146350/6a689eab-81ab-4e62-8065-5edc86b804b5