From 1cecbe7f440249ca68f4f6fef3948032e61843ac Mon Sep 17 00:00:00 2001 From: fkloft Date: Tue, 24 Sep 2013 13:47:01 +0200 Subject: [PATCH] Ignore canceled touch events in taphold.js Fixes #575 --- external/taphold.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/external/taphold.js b/external/taphold.js index cf16e280..1a76e183 100644 --- a/external/taphold.js +++ b/external/taphold.js @@ -106,12 +106,16 @@ $(this).bind((touchSupported ? "touchstart" : "mousedown"), data, startHandler) .bind((touchSupported ? "touchend" : "mouseup"), stopHandler) .bind((touchSupported ? "touchmove" : "mouseleave"), leaveHandler); + if(touchSupported) + $(this).bind("touchcancel", leaveHandler); }, teardown: function(namespaces) { $(this).unbind((touchSupported ? "touchstart" : "mousedown"), startHandler) .unbind((touchSupported ? "touchend" : "mouseup"), stopHandler) .unbind((touchSupported ? "touchmove" : "mouseleave"), leaveHandler); + if(touchSupported) + $(this).bind("touchcancel", leaveHandler); } }; })(jQuery);