Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Preventing next click after scrolling #12

iscy opened this Issue · 3 comments

3 participants


On the iPhone:
1. Scroll on a page
2. Hit an element that has onClick() function
=> Nothing happens
3. Hit it again
=> Works

The function: _preventNextClick() is the root cause of this issue. I'm not sure why this function was introduced in the first place... but removing its call from onTouchMove fixes my issue. I think the handler should be removed from onTouchEnd().


Here is a patch that fixes the issue by removing the prevent handler on onTouchEnd().

Index: web/touchscroll.js
--- web/touchscroll.js  (revision 5168)
+++ web/touchscroll.js  (working copy)
@@ -639,6 +639,8 @@
                                this.startFlick(flickVector, flickDuration);
+                       scroller.removeEventListener("click", preventHandler, true);
@@ -667,13 +669,15 @@
        _preventNextClick: function _preventNextClick(){
                var scroller = this.scrollers.container;
       = "transparent";
-               scroller.addEventListener("click", function prevent(event){
-                       event.stopPropagation();
-                       this.removeEventListener("click", prevent, true);
-              = "";
-               }, true);
+               scroller.addEventListener("click", preventHandler, true);
+       _preventHandler: function _preventHandler(event) {
+               event.stopPropagation();
+               scroller.removeEventListener("click", preventHandler, true);
+      = "";
+       },
        isAnimating: function isAnimating(){
                var timeouts = this._animationTimeouts;
                var hasTimeouts = timeouts.e.length > 0 || timeouts.f.length > 0;

Thanks for the patch … this will be fixed with the rewrite, I just don’t have much time left to finish it at the moment.


This is still happening (at least on Android phones), and I don't see that _preventNextClick function anywhere in the code, so I don't know how can I patch it. Any workaround for this? The project doesn't seem pretty active right now, but i'm hoping someone can answer me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.