Skip to content

Commit

Permalink
fix(tap): Do not simulate a click if it was from a touchcanel event, c…
Browse files Browse the repository at this point in the history
…loses #1015
  • Loading branch information
adamdbradley committed Apr 2, 2014
1 parent 5f3a1d2 commit 7851009
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/utils/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions js/utils/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7851009

Please sign in to comment.