0

I tried doing the following, but I still couldn't get vertical scrolling to work with the hammer.js element.

mc = new Hammer.Manager(myElement, {
    touchAction: 'auto',
    recognizers: [
        [Hammer.Pan,{ direction: Hammer.DIRECTION_HORIZONTAL }],
    ]
});

1 Answer 1

1

You want to support vertical scrolling on myElement then you need to add a Vertical Pan recognizer and not the horizontal recognizer.

The code should have been:

mc = new Hammer.Manager(myElement, {
    touchAction: 'auto',
    recognizers: [
        [Hammer.Pan, { direction: Hammer.DIRECTION_VERTICAL }],
    ]
});
1
  • From my tests, having touchAction: "auto" is enough. Commented May 8, 2019 at 16:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.