fix(tap): Do not simulate a click if it was from a touchcanel event, closes #1015

This commit is contained in:
Adam Bradley
2014-04-02 10:07:45 -05:00
parent 5f3a1d21c6
commit 78510099ad
2 changed files with 5 additions and 4 deletions

View File

@@ -1066,7 +1066,7 @@
doubletap_interval : 300
},
handler: function tapGesture(ev, inst) {
if(ev.eventType == ionic.Gestures.EVENT_END) {
if(ev.eventType == ionic.Gestures.EVENT_END && ev.srcEvent.type != 'touchcancel') {
// previous gesture, for the double tap since these are two different gesture detections
var prev = ionic.Gestures.detection.previous,
did_doubletap = false;

View File

@@ -47,9 +47,10 @@
var e = orgEvent.gesture.srcEvent; // evaluate the actual source event, not the created event by gestures.js
var ele = e.target;
if( isRecentTap(e) ) {
// if a tap in the same area just happened, don't continue
console.debug('tapPolyfill', 'isRecentTap', ele.tagName);
if( isRecentTap(e) || e.type === 'touchcancel' ) {
// if a tap in the same area just happened,
// or it was a touchcanel event, don't continue
console.debug('tapPolyfill', 'isRecentTap', ele.tagName, 'type:', e.type);
return stopEvent(e);
}