Mobiscroll and fastclick touchend/click incompatibility
THIS ISSUE IS FIXED:
https://github.com/acidb/mobiscroll/issues/83
I work on a project using both mobiscroll (for selecting stuff from a scrolling wheel) and fastclick (to remove the 300ms delay on iphone on touch events). However, I noticed that when closing a mobiscroll dialog, the click event would be sent to whatever item laying behind the mobiscroll panel.
I managed to reproduce the problem. It seemed that the buttons on the mobiscroll panel both listened to touchend AND click. And it turned out this was true: mobiscroll has defined their own "tap" event, which depends on the 300ms delay for not sending a click event on the elements below the mobiscroll panel.
Using fastclick and mobiscroll can therefor be problematic. But there is a nice fix:
In the mobiscroll.core-file, find this part:
el.bind('touchstart', function (e) { e.preventDefault(); move = false; touch = true; }).bind('touchmove', function () { move = true; }).bind('touchend', function (e) { if (!move) { handler.call(this, e); } }).bind('click', function (e) { if (!touch) { handler.call(this, e); } });
And replace with:
el.bind('click', function (e) { handler.call(this, e); });
Update
Seems like this applies to from mobiscroll 2.4.4:
"Changed: Set and cancel events are now fired on tap instead of click (on touchscreen)."













