angular-hammer icon indicating copy to clipboard operation
angular-hammer copied to clipboard

broken ios scrolling

Open waterplea opened this issue 8 years ago • 3 comments

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).

waterplea avatar Apr 14 '16 16:04 waterplea

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 avatar Apr 28 '16 11:04 Brototype

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"}'
>`

Brototype avatar Apr 28 '16 12:04 Brototype

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

gitzhaochen avatar Jul 24 '17 14:07 gitzhaochen