RyanMullins / angular-hammer

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

broken ios scrolling #70

Open waterplea opened 8 years ago

waterplea commented 8 years ago

Check out this issue: https://github.com/RyanMullins/angular-hammer/issues/62

How do you make such a basic functionality so hard to implement? I mean getting swipable navigation menu is probably the biggest reason people start using touch events in the first place. I cannot get this to work no matter how hard I try. Only tested on iPhone Safari, here's the Codepen, visit it on iPhone: http://codepen.io/waterplea/pen/aNYaOe I've made 3 different approaches there that I've tried, Codepen is pretty self explainatory. Note that it doesn't matter in which order I define hm-recognizer-options or put hm-swipeleft/hm-swiperight in the first approach - it only works for swipeleft if there are both used. Also note that leaving out type or making it empty does not work either (it is mentioned that if no type value is provided then options will be applied to all types - this either isn't true or "preventDefault" doesn't work in this case).

Brototype commented 8 years ago

It's not only ios We applied a hm-swipefleft and a hm-swiperight directive on our main container, which is nearly the size of our body. We did this to achieve a sort of pagination functionality on swipe. Now we can't scroll the main container vertically anymore. We have this issue on iOS, Microsoft Surface and can reproduce it with Chromes developer tools in device mode too. Are we doing something completely wrong here?

Brototype commented 8 years ago

Alrighty I've fixed it using a hint of another issue (#37) hm-recognizer-options='{"type":"swipe","directions":"DIRECTION_HORIZONTAL"}' did it for us

<main 
 hm-swipeleft="vm.swipeLeft()" 
 hm-swiperight="vm.swipeRight()" 
 hm-recognizer-options='{"type":"swipe","directions":"DIRECTION_HORIZONTAL"}'
>`
gitzhaochen commented 6 years ago

i have the same problem ,thank u for helping me out,hahaha!!!! @Brototype