Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Only fire tap for mouse if it came from a left click
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
dfreedm committed Feb 21, 2014
1 parent 0cded24 commit 5ffff58
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@
}
}
},
shouldTap: function(e) {
if (!e.tapPrevented) {
// only allow left click to tap for mouse
return e.pointerType === 'mouse' ? e.buttons === 1 : true;
}
},
pointerup: function(inEvent) {
var start = pointermap.get(inEvent.pointerId);
if (start && !inEvent.tapPrevented) {
if (start && this.shouldTap(inEvent)) {
var t = scope.findLCA(start.target, inEvent.target);
if (t) {
var e = dispatcher.makeEvent('tap', {
Expand Down

0 comments on commit 5ffff58

Please sign in to comment.