Norserium / react-indiana-drag-scroll

React component which implements scrolling via holding the mouse button or touch

Home Page:https://norserium.github.io/react-indiana-drag-scroll/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mobile stuttering

PabloSzx opened this issue · comments

Hey, I was having severe stuttering at the first attempt to drag scroll in mobile, so I just spent some time debugging and in the end I found a partial solution, which only works with activationDistance={1}.

I am not sure if this is a common problem, and if this solution opens other problems for other implementations of this library (not my case), and this solution is kinda improvised, so I don't know if it's an immediate pull request worthy solution.

Here is this published version if needed https://www.npmjs.com/package/@pablosz/react-indiana-drag-scroll

Hello, @PabloSzx! Could you send the video of your problem and check if the bug appears at this example?

Your solution looks like a blend of native mobile scrolling and non native mobile scrolling. It's pretty unpredictable.

Hello, @PabloSzx! Could you send the video of your problem

https://imgur.com/a/qSXjf48

Gifs recordings of the 4 options between fork - original, activation distance 1 vs 100

EDIT: (I changed the activation distances to 100 to be more easily caught in the recording)

and check if the bug appears at this example?

That example doesn't have the stuttering problem 😕

I did some fixes and publish the example version that includes them. I will prepare the new release soon.

Please update to 1.5.0

It's fixed 😄 it's buttery smooth on mobile too, and works with any activation distance 🎉

thank you very much

Frankly, the activation distance is currently useless for the native mobile scroll. It's determined by the browser.

@PabloSzx, could you check the example again?

I've realized that I break one feature during the fixing that bug (there might be an undesirable click after the end of scroll at the desktop).

@PabloSzx, could you check the example again?

I've realized that I break one feature during the fixing that bug (there might be an undesirable click after the end of scroll at the desktop).

I don't catch it, it seems fine to me

Thanks! Anyway, I will publish 1.5.1 that fixes that problem with click.