Describe the bug
Using stop, mousewheeling a bunch, and then using start causes the page to jump to where you would have scrolled to had you not hit stop before.
Logging window scroll events will also not register any while stopped, but when restarted all of those previously ignored wheel events trigger.
Lenis start/stop methods don't preserve this event history. If these are also triggered in the default start/stop methods, then this behaviour doesn't occur and it behaves as you would expect.
To Reproduce
Steps to reproduce the behavior:
use stop()
scroll via mousewheel
use start()
Expected behavior
When stopped, there should be no scrolling. When started, scrolling should start from where you are currently, regardless of any attempts to wheel in the meantime.
Hello 👋
Describe the bug Using stop, mousewheeling a bunch, and then using start causes the page to jump to where you would have scrolled to had you not hit stop before. Logging window scroll events will also not register any while stopped, but when restarted all of those previously ignored wheel events trigger.
Lenis start/stop methods don't preserve this event history. If these are also triggered in the default start/stop methods, then this behaviour doesn't occur and it behaves as you would expect.
To Reproduce Steps to reproduce the behavior:
Expected behavior When stopped, there should be no scrolling. When started, scrolling should start from where you are currently, regardless of any attempts to wheel in the meantime.
Example of Lenis start/stop: https://codepen.io/wearingalampshade/pen/JjwgZGp
This is particularly noticeable when using fixed position overlays such as modals, where we would want to stop the body scroll.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information): All
Thank you 👊