cubiq / iscroll

Smooth scrolling for the web
http://iscrolljs.com
MIT License
12.87k stars 3.8k forks source link

The elements are not replying to click() events when placed inside of an iScroll-ed block #991

Open turbodude opened 8 years ago

turbodude commented 8 years ago
jQuery 1.11.3
iScroll v5.1.3

Tried in: Chrome mobile emulator (devtools) Firefox on Android Android Browser

It works in desktop browsers and once I've removed the iScroll function, jQuery starts working as it supposed to in mobile browsers too.

kaansoral commented 8 years ago

there is an event pass through option, you can try that

there is a clicks option, you can try that

I also think https://github.com/ftlabs/fastclick overrides all these and send synthetic clicks, even if iscroll doesn't support it

TL;DR: there are various solutions, make sure you verify the solution you choose on ios/android, especially android

turbodude commented 8 years ago

Kaansoral Thank you for suggestions but eventually I just switched to another plugin, NiceScroll. It works not as smooth as Iscroll does, but there are no issues with click events. Iscroll definitely has some weird click handling because it doesn't even allow the simple CSS ":active" selector to show up in most instances...

kaansoral commented 8 years ago

yes the event handling of iscroll seems messed up to me at times too, since I use it on mobile, I kind of enjoy the missing :active's, sometimes changing some things brings back the :active's, I end up disabling them manually

Thanks for mentioning nicescroll, it looks interesting, I will check it out sometime, out of curiosity

I regularly check for iScroll alternatives yet never found a worthy one yet

kaansoral commented 8 years ago

yes the event handling of iscroll seems messed up to me at times too, since I use it on mobile, I kind of enjoy the missing :active's, sometimes changing some things brings back the :active's, I end up disabling them manually

Thanks for mentioning nicescroll, it looks interesting, I will check it out sometime, out of curiosity

I regularly check for iScroll alternatives yet never found a worthy one yet

Click/focus/keyboard events are problematic at mobile devices tho, so at one point, you might be forced to dig in deeper than you want to