Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zepto JS is making the scrolling in my phonegap app unresponsive

Anyone else had this before?

Scrolling works... but if you scroll too quickly the page just stays still. You need to do it kind of slowly.

I know it's zepto, too, as if I make a new page with just the zepto library imported (not even calling anything from it), it behaves this way. Remove it and the scrolling works perfectly again!

What gives... I thought zepto was supposed to just be a minimalistic jQuery-like library... but even the full jQuery library doesn't hinder my scrolling like this!


SOLVED, for me anyway.

Check the comments below.

like image 316
EvenStevens Avatar asked Nov 04 '22 01:11

EvenStevens


1 Answers

This is indeed happening on Android with Zepto Touch. Was pulling my hair out for hours on a PhoneGap app before stumbling here and finding it is Zepto that is the problem. (I had no problem on iOS after adding -webkit-overflow-scrolling: touch)

This was my workaround:

$('.scrolling').bind('touchmove', function(e) { e.stopPropagation(); }

This prevented Zepto's check for accidental touches from happening on certain divs that have scrolling enabled (in this case, with a manual 'scrolling' class) for me, but YMMV.

like image 60
zungaphobia Avatar answered Nov 08 '22 15:11

zungaphobia