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
{{ message }}
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
Hey, I'm trying to find out what causes a scroll jump up on a project I'm working on.
I have a focus section which when reached locks the scroll using asscroll.disable and once certain criteria are met (scrolled enough while being locked) unlocks the scroll using asscroll.enable with restore: true.
I'm dependent on the wheel event while the viewport is locked as that's what eventually triggers the unlock, so the user usually is scrolling the mousewheel (or trackpad) the moment when the scroll unlocks.
Now the problem I'm having is that the scroll position (or rather targetPos of asscroll) intermittently jumps upwards. I tried debugging it using breakpoints, but after half a day I did not get anywhere.
I have a theory that because asscroll handles the wheel event, once asscroll is enabled, the wheel event fires before the body height is restored and that probably confuses asscroll as it sets the targetPos (which I'm unable to set manually because it does not have a setter) higher in the page.
Hey, I'm trying to find out what causes a scroll jump up on a project I'm working on.
I have a focus section which when reached locks the scroll using
asscroll.disable
and once certain criteria are met (scrolled enough while being locked) unlocks the scroll usingasscroll.enable
withrestore: true
.I'm dependent on the
wheel
event while the viewport is locked as that's what eventually triggers the unlock, so the user usually is scrolling the mousewheel (or trackpad) the moment when the scroll unlocks.Now the problem I'm having is that the scroll position (or rather
targetPos
of asscroll) intermittently jumps upwards. I tried debugging it using breakpoints, but after half a day I did not get anywhere.I have a theory that because asscroll handles the
wheel
event, once asscroll is enabled, thewheel
event fires before the body height is restored and that probably confuses asscroll as it sets the targetPos (which I'm unable to set manually because it does not have a setter) higher in the page.I've prepared an example codepen from the forked ASSCroll Basic Demo here: https://codepen.io/linkus/pen/oNeRQga?editors=1111
It's very intermittent, but you can replicate the issue by scrolling slowly down while the viewport is locked.
I've also made a video of the issue (despite me scrolling down only, it jumps up when unlocking):
CleanShot.2021-11-23.at.18.24.26.mp4
@ashthornton if you could have a look it would be extremely helpful! Thanks!
The text was updated successfully, but these errors were encountered: