Hammer.js: Pan events not firing on straight vertical pan

Created on 26 Jul 2016  路  2Comments  路  Source: hammerjs/hammer.js

I'm experiencing a strange issue where pan events (panstart, pan, panend) are not firing, but only when the cursor is dragged vertically up or down in a straight line. The events fire ok if the drag deviates from that line, or if the cursor is dragged horizontally.

There's a reproduction of the issue here - http://codepen.io/gingerchris/pen/BzVojW

Using hammer 2.0.8.
I've tested in up-to-date versions of Safari, Chrome and Firefox, all on OSX 10.11.5 and with both a trackpad and mouse

Most helpful comment

Just discovered that explicitly setting direction: DIRECTION_ALL fixes this issue.
The default direction appears to be set to DIRECTION_HORIZONTAL but the docs suggest it should be DIRECTION_ALL.

See http://codepen.io/gingerchris/pen/PzaPRK

All 2 comments

Just discovered that explicitly setting direction: DIRECTION_ALL fixes this issue.
The default direction appears to be set to DIRECTION_HORIZONTAL but the docs suggest it should be DIRECTION_ALL.

See http://codepen.io/gingerchris/pen/PzaPRK

The default is horizontal because all prevents scrolling and so is not a good default value. To receive vertical pan you need to set all. Closing as this is not a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

homerlex picture homerlex  路  3Comments

elmerbulthuis picture elmerbulthuis  路  3Comments

wp2123 picture wp2123  路  4Comments

ghost picture ghost  路  10Comments

f3rixi picture f3rixi  路  6Comments