Closed forresto closed 10 years ago
Tried to make a reduced case with your example, changing to Polymer 0.4.0. Seems up
and down
are the only events that fire within the custom element: http://jsbin.com/tobon/1/edit
Hmm seems the same without the Polymer element: http://jsbin.com/bonige/1/edit?html,js,output
I have working example here https://rozhdestvenskiy.ru/dev/gestures/polymer-gestures/samples/image/index.html
It uses my fork with all my PR's. I think your problem can be fixed with this one — https://github.com/Polymer/polymer-gestures/pull/48
@sbmaxx Thanks for taking a look. Seems the same with yours, unless I'm missing something: http://jsbin.com/cavuh/1/edit
You should use
PolymerGestures.addEventListener(capture, en, function(inEvent) {});
instead of capture.addEventListener
. https://github.com/Polymer/polymer-gestures/blob/master/src/dispatcher.js#L401-L406
Demo — http://jsbin.com/votobeyonimu/1/
cc @forresto
Thanks for the tip. It actually works with the distributed 0.4.0 now: http://jsbin.com/meguma/1/edit
It actually works with the distributed 0.4.0
try it on mobile ;) i made this fix while developing for iphone/ipad
I was relying on polymer-gestures to make gesture events on various svg children of my custom element. Did something change there?
Edit: It doesn't work on the child elements on mobile either.
Edit: It was just an issue of the api changing from
node.addEventListener(eventname, handler, capture);
to
PolymerGestures.addEventListener(node, eventname, handler, capture);