ngryman / jquery.finger

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

Tap event is fired twice on Firefox 26 #18

Closed benface closed 10 years ago

benface commented 10 years ago

Here's my code:

<script>
$(document).ready(function() {

    $.Finger.preventDefault = true;
        $("body").on("click", function(e) {
            e.preventDefault();
        });

        $("body").on("tap", "a", function(e) {
            e.preventDefault();
            alert("test");
        });
});

All browsers work fine, except Firefox (version 26.0) that fires TWO "test" alerts instead of one.

ngryman commented 10 years ago

Hi,

Thanks, I confirm the behavior: http://jsfiddle.net/9snbz/2/.

ngryman commented 10 years ago

After investigating, it seems that this is a bug related to Firefox's alert implementation... I know this sounds weird, but when you replace alert('test') by console.log('test'), there is only one log. It seems to happen also with jQuery standard events: http://yuji.wordpress.com/2010/02/22/jquery-click-event-fires-twice/.