dkaoster / scrolly-video

Components for scroll-based (or other externally controlled) playback.
https://scrollyvideo.js.org/
MIT License
965 stars 39 forks source link

Request: improve programmatic scrolling experience #106

Closed tarsisexistence closed 3 months ago

tarsisexistence commented 4 months ago

setScrollPercent ignores scrolling "in progress" (i.e. the one that has been called but not finished), which doesn't allow us to have accurate results when we want to run them whenever we want.

In my scenario, it's possible that I configured two viewports with "autoplay" in a row. So when a user encounters the first viewport with autoplay, it invokes setScrollPercent to autoplay through this viewport to the next one. However, the next one is also configured as an autoplay, and it invokes setScrollPercent as well, which ends up in a collision and not accurate scroll position in the end.