You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When resizing from mobile to desktop or visa-versa. The progress stops working and only returns 0 or 1. This doesn't seem to happen when you resize just a little bit. Only large changes.
I think what happens in this case is that the resize causes the trigger line to be outside of the window, at which point the trigger line is no longer functional. When you force a scrollama.resize() after resizing the window then also the trigger line is redrawn inside in the window and progress works.
The issue is not only for the progress, it also happens in sticky-side. When you resize the screen to very small the trigger no longer happens when you scroll up and down.
I'm not certain what the cause was, but calling a debounced scrollama.resize() fixed this problem for me.
My assumption is that the built-in resize observer in 3.0 is responding too quickly, and the layout reflow hasn't finished yet, and that's causing some kind of problem. It could be that one or more of my steps is in an intermediary state that makes the trigger line outside of the window, as @JidduAlexander suggested.
When resizing from mobile to desktop or visa-versa. The progress stops working and only returns 0 or 1. This doesn't seem to happen when you resize just a little bit. Only large changes.
You can see it happening by resizing the example here in chrome or firefox (edge seems to work for some reason) https://russellsamora.github.io/scrollama/progress/
The text was updated successfully, but these errors were encountered: