elastic-scroll-polyfill icon indicating copy to clipboard operation
elastic-scroll-polyfill copied to clipboard

Make it work on Android

Open atomiks opened this issue 6 years ago • 4 comments

Seems like mobile Chrome doesn't fire the wheel event when scrolling.

atomiks avatar Nov 06 '18 20:11 atomiks

Hello, I added support for Chrome on Android in my fork here: https://github.com/SkoshRG/elastic-scroll-polyfill

Would you be willing to merge this into the master branch if i cleaned up the extra dependencies (eg. parcel) and other small changes i made?

The way it works now is it uses a passive scroll event listener which calculates the deltas, and does the rest the same way your onWheel function does it.

skoshx avatar Mar 25 '20 15:03 skoshx

Thanks! Sure.

Does that also fix the issue where sometimes the effect doesn't work at all? I've noticed that sometimes the scrolling instantly stops when reaching the scrolling boundary and the effect isn't reliably applied :\

atomiks avatar Mar 25 '20 15:03 atomiks

Hello, from the testing I have done, there doesn't appear to be any issues with the effect not working.

Also, if I have the time I would also try to implement the elastic-scroll when you are at the top of the scroll container. (eg. make it behave exactly similar to iOS scroll)

Anyways, I will now prepare my fork so that only the minimal changes are added, and then I will open up a pull request. Awesome library by the way, and the code is SUPER clean, love it!

skoshx avatar Mar 26 '20 12:03 skoshx

Also, if I have the time I would also try to implement the elastic-scroll when you are at the top of the scroll container. (eg. make it behave exactly similar to iOS scroll)

I don't think that's possible as there's no trackpad release event unfortunately. But if you can come up with a solution that'd be amazing. It's something I've been wanting to achieve but haven't been able to.

Anyways, I will now prepare my fork so that only the minimal changes are added, and then I will open up a pull request. Awesome library by the way, and the code is SUPER clean, love it!

Great, thanks!

atomiks avatar Mar 26 '20 12:03 atomiks