lenis icon indicating copy to clipboard operation
lenis copied to clipboard

Optionally disable smooth scrolling on trackpads

Open blehn opened this issue 2 years ago • 5 comments

Lenis seems to work pretty nicely with a mousewheel, but on MacOS, the native trackpad already has smooth scrolling with acceleration and momentum. Adding Lenis smooth scrolling on top of that makes scrolling feel too loose and unresponsive. There's no official trackpad detection that I know of, but it seems that there are some solutions: https://stackoverflow.com/questions/10744645/detect-touchpad-vs-mouse-in-javascript. I'd love to be able to enable or disable Lenis for trackpads and mousewheels independently.

blehn avatar Oct 01 '23 05:10 blehn

https://codepen.io/ClementRoche/pen/eYbLWLV

This needs to be tested on different devices, not only MacOS

clementroche avatar Oct 02 '23 21:10 clementroche

this is a tricky one, i'm using a Logi MX Master 3 mouse on MacOS Sonoma, and the wheel is detected as trackpad.. i don't think there's a reliable way to detect trackpad only.

arzafran avatar Oct 03 '23 13:10 arzafran

https://codepen.io/ClementRoche/pen/eYbLWLV

This needs to be tested on different devices, not only MacOS

@clementroche This detects my macOS M1 touchpad as a mousewheel - unless I scroll sideways then it detects the track pad.

Krislunde avatar Nov 16 '23 13:11 Krislunde