RyanMullins / angular-hammer

Hammer.js v2 support for AngularJS
http://ryanmullins.github.io/angular-hammer/
MIT License
188 stars 55 forks source link

hm-swiperight stops me from scrolling... #34

Closed quadrupleslap closed 9 years ago

quadrupleslap commented 9 years ago

I don't know if this is intended behaviour or not, but when I use the hm-swipeleft or hm-swiperight directive on an li, I can't scroll the list by dragging that li normally.

quadrupleslap commented 9 years ago

Although I suspect preventDefault in the options might fix that. =) Edit: Nope, nevermind. =\

mattmcdonald-uk commented 9 years ago

Do you have an example for this issue?

quadrupleslap commented 9 years ago

Here's what I have, but what happens is if preventDefault isn't specified, no scrolling is possible, and if it is specified as false, then the swipe event never gets fired.

<ul class="entries">

  <li ng-repeat="entry in entries | reverse | orderBy: '!!complete'"
      ng-class="{complete: entry.complete}" class="entry"

      hm-recognizer-options='{"type":"swiperight", "threshold":10, "preventDefault":false}'
      hm-swiperight="editEntry(entry, {complete: !entry.complete})"

      animated-reorder>
    <button class="glyphicon glyphicon-ok" ng-click="editEntry(entry, {complete: !entry.complete})" ink-ripple></button>
    <p ng-bind="entry.title || entry.input"></p>
  </li>

</ul>
mattmcdonald-uk commented 9 years ago

I can't reproduce this.

Created a similar structure to yours (without specifying preventDefault) and the ul scrolls fine and the swiperight event is also firing fine.

If you're sure it's a library bug, can you provide a plunker or similar with a runnable/reproducible issue.

quadrupleslap commented 9 years ago

Whoops, sorry, it's my fault. I was doing something really stupid with overflow-scrolling.