Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

ngTouch: In swipe directives, Event object is not available as $event #4071

Closed
tromex opened this issue Sep 20, 2013 · 4 comments
Closed

ngTouch: In swipe directives, Event object is not available as $event #4071

tromex opened this issue Sep 20, 2013 · 4 comments
Assignees
Milestone

Comments

@tromex
Copy link

tromex commented Sep 20, 2013

Hi there!, in the docs it says that Event object should be available as $event on swipe directives (http://docs.angularjs.org/api/ngTouch.directive:ngSwipeLeft), this is not working. It only works for ng-click. Here is an example in Plunker:

http://plnkr.co/edit/I0DvVA?p=preview

I'm trying to access $event in the swipe directive to use $event.stopPropagation() because sometimes (not always) I'm getting a click event after the swipe event. You should also see this behavior in the example... (maybe is this another bug?). Greets!

@ghost ghost assigned bshepherdson Sep 21, 2013
@jsteenkamp
Copy link

Can confirm the same - issue I'm having is that swipeRight triggers in desktop when selecting text with mouse.

@akent
Copy link
Contributor

akent commented Oct 8, 2013

The swipe handler is triggered on mouseup or touchend, once the swipe has finished. It's possible to add $event back to the ng-swipe scope as per ng-click (it will be a mouseup or a touchend) but then using stopPropagation on it won't have the effect you desire because a separate click event is still being generated.

jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Existing documentation implies that an Event object should be available
as `$event` on swipe directives, which previously was only working for
`ng-click`.

Closes angular#4071
Closes angular#4321
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this issue Jan 27, 2014
Existing documentation implies that an Event object should be available
as `$event` on swipe directives, which previously was only working for
`ng-click`.

Closes angular#4071
Closes angular#4321
@nicolethenerd
Copy link

@jsteenkamp Were you ever able to resolve that issue? I'm having the exact same problem.

@jsteenkamp
Copy link

@nbieber - did not get back to it. I just removed swipe for menu reveal on project and planned to reinstate it later.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants