-
-
Notifications
You must be signed in to change notification settings - Fork 485
Open
Description
For a custom application, i need to stop the scrolling, manually apply a scrollTo then resume normal scrolling.
From my testing, i can see that after restarting / reseting the lenis scroll, the previous scroll "momentum" is reapplied which create an unwanted ghost scrolling.. Any idea how to fix that?
lenis.stop();
requestAnimationFrame(() => {
triggerSnap(target, align, reset, lastVelocity)
})
triggerSnap = ()=>{
[compute some parameters]
const scrollParams = {
lock: true,
force: true,
duration: 0.2,
onComplete: () => {
snapTriggered = false;
snapSection = null;
lenis.reset()
lenis.start();
}
}
lenis.scrollTo(lenisScrollPositionElement, scrollParams)
}
=> after the call to reset and start, the window resume a scroll in the direction and the desired behaviour is a complete stop
Metadata
Metadata
Assignees
Labels
No labels