lenis
lenis copied to clipboard
Optionally disable smooth scrolling on trackpads
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.
https://codepen.io/ClementRoche/pen/eYbLWLV
This needs to be tested on different devices, not only MacOS
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.
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.