lenis icon indicating copy to clipboard operation
lenis copied to clipboard

Different scroll speed on different browsers

Open KarolisVaitiekunas11 opened this issue 2 years ago • 11 comments

Describe the bug While working with the library, I noticed that the scroll speed is very different across browsers. On Chrome the scroll is way slower than the scroll on Firefox. I was able to reproduce this issue in linux, mac and windows.

To Reproduce You can reproduce it in the official demo. While scrolling with the same speed you can see that on Firefox you will scroll way faster than on Chrome.

KarolisVaitiekunas11 avatar Mar 07 '23 09:03 KarolisVaitiekunas11

Which version of the lib are you using? Since v1 a normalizeWheel options has been introduced and should fix this kind of issues.

https://github.com/studio-freight/lenis/blob/main/README-v1.md#instance-settings

clementroche avatar Mar 07 '23 10:03 clementroche

I'm using the latest 1.0.0-dev.8. The normalizeWheel option does not seem to do anything, same as in demo.

KarolisVaitiekunas11 avatar Mar 07 '23 11:03 KarolisVaitiekunas11

Are you using a trackpad or an actual mouse ?

clementroche avatar Mar 07 '23 12:03 clementroche

Using a mouse each wheel is currently 100

clementroche avatar Mar 07 '23 12:03 clementroche

@clementroche I'm on version 1.0.0-dev.7 and setting normalizeWheel does not seem to change anything. The current behavior (with 1.0.0-dev.7) seems to be the old one, where Chrome scrolls a lot further than Firefox.

Maybe it's a regression? I thought it really was fixed in an earlier version. :thinking:

thasmo avatar Mar 07 '23 17:03 thasmo

Yes it has been fixed in the past @thasmo. What's the value you get on Chrome ? On my side Chrome deltaY is 100 with both normalizeWheel: true and normalizeWheel: false, Firefox is 100 with normalizeWheel: true and 102 on normalizeWheel: false. The only context where it can be an issue is when you wheel deltaY is < 100

clementroche avatar Mar 07 '23 22:03 clementroche

@clementroche, nevermind - I'm not sure where I was looking at, but so far it seems to work fine with 1.0.0-dev.7, although I thought I was sure it wasn't. I guess I need to take a closer look at it anytime soon to figure out what was going on. For now I can't reproduce.

thasmo avatar Mar 09 '23 19:03 thasmo

It seems, that the mentioned scroll behavior appears when we are using instance.stop() and instance.start().

darius-kul avatar Mar 14 '23 07:03 darius-kul

Currently normalize wheel across browsers and OS seems impossible, everyone is using a different scroll device or configuration and it's impossible to detect such things

clementroche avatar Mar 29 '23 09:03 clementroche

I still get this issue, even on your page (https://lenis.studiofreight.com/). Chrome scrolls further than Firefox. I get that it's nearly impossible to normalize this across all browser but from a library that headlines with Normalize all your User Inputs I actually expected this to work… As I understand there is currently no way to normalize this?

sandrodunkel avatar Jun 02 '23 08:06 sandrodunkel

@sandrodunkel it's open source, if you find a solution I would be super happy to just merge your PR

clementroche avatar Jun 02 '23 09:06 clementroche