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 #62

Closed frankville closed 9 years ago

frankville commented 9 years ago

Hello everyone, I'm working on an app that has a div with an absolute position, an overflow-y: scroll, z-index:1 and a hm-swipeleft attribute (sort of a navigation drawer that hides when swipe to the left). Everything works fine on all devices except in iOS (safari and chrome). The problem I'm having is that the content of the div won't scroll unless I remove the hm-swipeleft attribute. I tried disabling preventDefault and stopPropagation with hm-recognizer-options but I couldn't get it to work. Here is a code sample to test

`

</div>`

any ideas will be appreciated. Thanks in advance

lsiric commented 9 years ago

Prevent default does not work as an option because nobody mentioned hm-recognizer-options, when used in html, should be marked with SINGLE quotes, and attributes inside with DOUBLE quotes:

hm-recognizer-options='{"type":"swiperight","preventDefault":false}'

If you take a closer look to 'official demo', you will notice this is the only property in html used with single quotes. I'd say this is a serious flaw with the documentation in general, because it seems a lot of people are having the same struggle, only because of this 'single quotes issue'.

cheers

frankville commented 9 years ago

Problem solved! Thank you very much.