Giter Site home page Giter Site logo

Comments (11)

ayamflow avatar ayamflow commented on August 30, 2024

Hi @jankohlbach !
Thanks for looking into it. I had not heard about this issue before but I think it would be great to find a fix for VirtualScroll.
I think the fix will probably use something similar to what's on this stackoverflow answer to toggle between wheelDeltaY and deltaY.

I am not sure when I will be able to incorporate this as a stable fix, so in the meantime, a temporary fix could be something like:

new VirtualScroll({
    mouseMultiplier: isTrackpad && isFirefox ? 1/3 : 1
})

where isTrackpad comes from the above stackoverflow link, and isFirefox is obtained from user-agent sniffing.
1/3 is because I believe the trackpad will fire at 300% the rate of the mouse but I could be wrong - tweak at will.
Let me know if that works for you!

Edit: it looks like wheelDetaX/Y are deprecated so I might just remove them altogether. Just need to test a bit.

from virtual-scroll.

jankohlbach avatar jankohlbach commented on August 30, 2024

Hey @ayamflow,
thanks for the response :)
It's extremely busy for me as well right now, so don't worry.
Thanks for looking into it 💯

from virtual-scroll.

jankohlbach avatar jankohlbach commented on August 30, 2024

Hey @ayamflow ,
do you have any news regarding this? asking because the folks at locomotive are working on the issues and making updates, so maybe it would be nice if this is fixed

from virtual-scroll.

ayamflow avatar ayamflow commented on August 30, 2024

hey @jankohlbach,
I looked at https://locomotivemtl.github.io/locomotive-scroll/ on Chrome & Firefox and the scroll speed looks the same to me, on a trackpad.
Can you confirm that you see an obvious difference on this site between Firefox and other browsers? What OS are you on?

from virtual-scroll.

jankohlbach avatar jankohlbach commented on August 30, 2024

@ayamflow
hmm ... yeah it's pretty obvious 😅
I'm on windows 10, dell xps13, are you on a mac?
maybe it's even device related ...

from virtual-scroll.

ayamflow avatar ayamflow commented on August 30, 2024

Yep, I'm on mac.
I just gave it a try on Windows 10 with Parallels desktop and there was no noticeable speed difference either. It's the same trackpad tho so maybe it's a device thing, but it's surprising that it would only affect firefox 🤔
Does this shows isTrackpad: true for you ? https://jsfiddle.net/ayamflow/j09qsrLd/7/ (when scrolling in the white rect)

I'm thinking I could expose another param trackpadMultiplier: 1 (default) and let the user find the best value for their use case, as I don't want to add a breaking behavior.

from virtual-scroll.

jankohlbach avatar jankohlbach commented on August 30, 2024

as much as I'd like to see more people using firefox, in this case it's a good thing only few people (and even less with trackpad) are using it 😂
your fiddle shows nothing for me 🤔
maybe also your idea from above could be enough for the moment then ...

from virtual-scroll.

ayamflow avatar ayamflow commented on August 30, 2024

@jankohlbach you need to scroll in the white area for the jsfiddle to display something 👀

from virtual-scroll.

jankohlbach avatar jankohlbach commented on August 30, 2024

@ayamflow I promise you I don't see anything 😂 maybe onwheel doesn't capture the trackpad, but only mousewheel ...
or I just throw this specific laptop out of the window ...

from virtual-scroll.

makc avatar makc commented on August 30, 2024

@jankohlbach

Basically, if I'm in Firefox and using a trackpad, the scrolling is way too fast.

I think it is because this lib assumes the firefox is slow, and it isn't ¯\_(ツ)_/¯

firefoxMultiplier: Firefox on Windows needs a boost, since scrolling is very slow. Defaults to 15.

and here I am, scrolling locomotive demo in firefox on windows to the bottom in a split-second :')

@ayamflow,

where isTrackpad comes from the above stackoverflow link

for me those snippets just do not detect a touchpad at all. they probably work on authors hardware only.

from virtual-scroll.

makc avatar makc commented on August 30, 2024

ah no, I take it back - not a firefox issue for me, locomotive demo scrolls super-fast in chromium as well

from virtual-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.