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

Bug: chrome android click is not prevented #43

Open mauron85 opened 9 years ago

mauron85 commented 9 years ago

Expected: onTouchStart event set usingTouch to true, which should prevent extra click event in chrome for android.

Actual: After touchend event usingTouch is set to false and click event is fired. As result callback is called twice (tap + click)

The problem is that idleStateInit is called for unknown reason and this.usingTouch is set there to false. So next onMouseUp event is fired, usingTouch is false and as result callback is called twice (once by touchstart and once by mouseup)

Following call stack in chrome for android confirms that:

idleStateInit (slip3.js:207) window.Slip.Slip.setState (slip3.js:508) window.Slip.Slip.states.undecided.onEnd (slip3.js:265) window.Slip.Slip.onTouchEnd (slip3.js:694)