ngryman / jquery.finger

:v: jQuery touch & gestures, fingers in the nose.
https://ngryman.sh/jquery.finger/
MIT License
423 stars 66 forks source link

event.preventDefault() within tap event on links not working on mouse click #24

Closed jaydenseric closed 9 years ago

jaydenseric commented 9 years ago

The following works as expect on touch devices, but not when using a mouse:

$('a').on('tap', function(event) {
    event.preventDefault();
    alert('Link clicked!');
});

Unexpectedly on desktop the native link behaviour is triggered, redirecting the page.

Using the latest minified distribution script.

jaydenseric commented 9 years ago

This divergent behaviour is really killing me, if I can't get confirmation on this bug soon I will have to drop jQuery finger for this project :(

ngryman commented 9 years ago

I'm checking this right now :)

ngryman commented 9 years ago

This should be fixed now in 0.1.1.

jaydenseric commented 9 years ago

Legend! I'll test this out when I get back into the office tomorrow morning.