locomotive-scroll icon indicating copy to clipboard operation
locomotive-scroll copied to clipboard

Lerp causing choppy mousewheel scroll

Open developedbygeo opened this issue 2 years ago • 0 comments

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):

  • OS: MacOS Monterey 12.5, Win10
  • Browser: Chrome, Firefox

Thank you in advance!

developedbygeo avatar Dec 20 '22 14:12 developedbygeo