Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUGE BUG - ABSOLUTELY NO STOPPROPAGATION() and NO PREVENTDEFAULT() #23

Open
jonnydungeons opened this issue Oct 27, 2014 · 9 comments
Open

Comments

@jonnydungeons
Copy link

How can a plugin based on events have no concept of stop propagation and prevent default especially when it piggy backs off of the Hammer.js that supports this???

I have to say that since I spent the time to integrate this into my solution I will be quite annoyed if there is not a fix or a hot fix or something to hold this BIG BUG.

@jonnydungeons
Copy link
Author

The following sitch is a NO GO -
index.html --

View Details

someController.js --
angular.module('controllers').controller("SomeController", ["$scope", "$http", "SomeService",
function($scope, $http, SomeService) {
$scope.tapEvent = function(id) {
alert('this click should not show for ' + id);
};
$scope.nestedTapEvent = function(id, event) {
event.stopPropagation();
event.preventDefault();
event.gesture.stopPropagation();
event.gesture.preventDefault();
event.gesture.stopDetect();
alert('this should def show for ' + id + ' but it should not fire tapEvent');
};

@wzr1337
Copy link
Owner

wzr1337 commented Oct 29, 2014

Any PR is welcome :)

I'll try to work on integrating hammer 2.0 shortly..

@wzr1337
Copy link
Owner

wzr1337 commented Nov 10, 2014

I did not get stopPropagation() to work properly yet but I will try to get it done soon

@gercheq
Copy link

gercheq commented Dec 2, 2014

@wzr1337 what's the status of this? is there a fix already? I'm having similar problems with propagation.

@wzr1337
Copy link
Owner

wzr1337 commented Dec 7, 2014

actually I am to busy currently to work on it and Ido not yet have a fix for it..

@mullen3
Copy link

mullen3 commented Dec 17, 2014

I just worked on this for a while and couldn't figure it out. Do you think it's because the event is being passed inside a $timeout?

@gyllen
Copy link

gyllen commented Jan 30, 2015

+1 on this. Kind of makes this otherwise awesome module unusable.

@wzr1337
Copy link
Owner

wzr1337 commented Jan 30, 2015

The thing is that hammer does not provide these features on its regular
events. Only if you let hammer fire actual DOM events, stopPropagation and
default prevention become usable with some drawbacks like performance..

I am currently fiddling around with some additional code, but I need some
more experiments as it is not all to obvious how to achieve the goal :(

On Friday, January 30, 2015, Johan Gyllenspetz notifications@github.com
wrote:

+1 on this. Kind of makes this otherwise awesome module unusable.


Reply to this email directly or view it on GitHub
#23 (comment)
.

  • Dr. Patrick Bartsch
    (web)

@ryeballar
Copy link

Hammer provides an event objects for their event handlers. As I see it in their documentation, the event object has a srcEvent object which represents the source of the event. The angular-gestures plugin directives passes the $event object that has this srcEvent object.

To stop propagation you can simply do $event.srcEvent.stopPropagation(), they also have provided a direct access for the srcEvent for preventDefault(), so you can do $event.preventDefault() as you like or do $event.srcEvent.preventDefault().

Source: Hammer API

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

No branches or pull requests

6 participants