kornelski / slip

Slip.js — UI library for manipulating lists via swipe and drag gestures
BSD 2-Clause "Simplified" License
2.44k stars 213 forks source link

slip:tap fires twice #10

Closed mauron85 closed 10 years ago

mauron85 commented 10 years ago

I think it's bug.

slip:tap fires two kinds of events

Slip.Slip.onTouchEnd Slip.Slip.onMouseUp

it makes toggling (eg. toggleClass) unusable as one cancels another

Device: Nexus 4 OS: Android 4.4 Browser: Chrome 33

kornelski commented 10 years ago

That's odd. addMouseHandlers() is called only in onMouseDown and only if this.usingTouch is false.

Try adding:

        if (this.usingTouch || e.button !== 0) return;

after onMouseUp: function(e) {. Does this help?

kornelski commented 10 years ago

I can't reproduce. I've added some defensive code just in case.