locomotivemtl / locomotive-scroll

πŸ›€ Detection of elements in viewport & smooth scrolling with parallax.
https://locomotivemtl.github.io/locomotive-scroll
MIT License
7.55k stars 1.11k forks source link

Lerp causing choppy mousewheel scroll #484

Open developedbygeo opened 1 year ago

developedbygeo commented 1 year ago

Hello πŸ‘‹

Describe the bug

I am using locomotivescroll on a couple of websites and I really like the smooth scroll effect. However, I have noticed that, when setting the lerp instance option to anything above the default 0.1, scrolling with the mouse wheel feels choppy. Effectively, the root cause of this issue is that the transform: matrix3d() b4 value stops as soon as the mousewheel does. This is particularly visible when setting lerp: 0.8 and using the mousewheel to scroll up and down, on both Windows and MacOS.

To Reproduce

A simple, reproducible example of the issue can be found here https://github.com/developedbygeo/locomotive-issue . Feel free to fork the repository to try it out.

Expected behavior For the scroll to be relatively smooth, based on the lerp, and not choppy. The issue disappears when reverting to the default lerp value or when using a trackpad with the same lerp value.

Desktop (please complete the following information):

Thank you in advance!