hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this

Home Page:http://hammerjs.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Horizontal swipe event has utterly random direction values, including none, up, down, etc.

php4fan opened this issue · comments

  1. Run this on a mobile device: https://codepen.io/php4fan/pen/mdgwBdb
  2. Swipe left and right

Expected: the logged value, which is the direction property of the swipe event, should always be 2 when you swipe left and 4 when you swipe right.

Observed: the value sometimes is 1 (NONE) or even 8 (UP).

According to documentation, by default only horizontal swipe recognition is enabled. And indeed, the event does only fire when you swipe horizontally, as expected. However, the value of direction sometimes is neither left nor right, which makes no sense.