addEventListener


#1

When I addEventListener to a label embedded in a gridlayout that has a pan eventListener, only one event is fired. This is being added programatically like so.

    lbl.addEventListener('tap', (data:EventData)=>{this.onDragTap(data)});
    gridLayout.addEventListener('pan', (data:PanGestureEventData)=>{this.onPan(data)});
    gridLayout.addChild(lbl);
  this.cl.addChild(gridLayout);

Both events work on ios, but on android I have to comment out 1 to get the other to work. Is there a way for me to have two events on the same elements?


#2

Use data.type to track the exact event, value should be one of GestureTypes


#3

Actually one event is on an element embedded inside of the other element. Does data.type work on two elements?


#4

Android may prevent event on parent element when child element is active. I think you should be just able to use pan event on your gird layout, use type to detect whether it was tap.