Skip to content

Commit

Permalink
Fix clicks bubbling on windows phone
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Zhlobo committed Jan 21, 2015
1 parent 91a2b08 commit 7edeb74
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

move: function( e ) {
if (!coords['start'] && !coords['move']) return false;

e = utils.getRealEvent( e );

coords.move = [ e.pageX, e.pageY ];
Expand All @@ -34,6 +34,15 @@
e = utils.getRealEvent( e );

if ( coords.offset[ 0 ] < Tap.options.fingerMaxOffset && coords.offset[ 1 ] < Tap.options.fingerMaxOffset && !utils.fireFakeEvent( e, Tap.options.eventName ) ) {
if ( window.navigator.msPointerEnabled || window.navigator.pointerEnabled ) {
var preventDefault = function( clickEvent ) {
clickEvent.preventDefault();
e.target.removeEventListener( 'click', preventDefault );
};

e.target.addEventListener( 'click', preventDefault, false );
}

e.preventDefault();
}

Expand Down

0 comments on commit 7edeb74

Please sign in to comment.