mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(tap): Do not simulate a click if it was from a touchcanel event, closes #1015
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user