angular-scrolly
angular-scrolly copied to clipboard
ngClick is invoked when scrolling
Hello,
I'm using angular-scrolly
in a PhoneGap app and it's working quite well :+1:
Only one problem. Sometimes when scrolling it happens that the ngClick
directive of ngTouch
is invoked.
I fixed this for me by inserting
if (self.state.distance.y > 20 || self.state.distance.y < -20) {
e.preventDefault();
}
before https://github.com/ajoslin/angular-scrolly/blob/master/src/services/dragger.js#L280 (line 280)
I'm checking whether the users scrolls more than 20
pixels. I know there has to be a better solution but I'm not very familiar with the angular-scrolly
code... :)
Regards, Andre
hmm. This fix would stop things like click-n-drag unfortunately.
Could you create a reproduce case on plnkr.co?
http://run.plnkr.co/ONe8rbUiOvcSeZlq/ Well, it seems to work well on that test page... :/ I'll have a look on that tomorrow. These are my directives/services/... I'm using:
'ngTouch' 'ngRoute' 'jm.i18next' 'ajoslin.scrolly' 'ajoslin.mobile-navigate' 'snap'
Even if this would stop things like click-n-drag, it helps me. And I don't have any click-n-drag thing in my app :D
Regards, Andre