darkroomengineering / lenis

How smooth scroll should be
https://lenis.darkroom.engineering
MIT License
7.35k stars 315 forks source link

scrollTo sometimes does not complete when using a touchpad #271

Closed ivan-pixels closed 3 months ago

ivan-pixels commented 7 months ago

Hi, Im trying to implement something like scroll snap with lenis, I used the plugin f linked in the readme as a starting point, and it works great with mouse scrolling, but im having an issue with it while using a touchpad, the scrollTo almost never completes (and the onComplete function is never called.

I can get around this by using lock: true, but I like how it works without lock: true on a scroll wheel. I assume this is happening because on the momentum? Is there anyway around this?

Here is a codepen showint the issus https://codepen.io/hadashi/pen/eYxLbeG

Thanks

clementroche commented 5 months ago

Can you isolate your issue as much as possible ? This seems too complex to be fixed as it is now, it may not be an actual "issue" but more related to what you're trying to achieve.