Propagating mouse events

Hi!

I have several sibling nodes with MOUSE_DOWN event listener and I want them to forward event to underlying (manual z-order) nodes, that were also hit by mouse click, unless I explicitly call event.stopPropagation(). However only the topmost node’s event listener is called. And event._propagationStopped field is already set to true and there is nothing I can do about it.
I’m pretty sure there’s an easy way to change this default event behavior, but I just can’t seem to find it. What am I missing here?

1 Like

Hi Persy, sorry to revive this old topic, but were you able to find a solution to this?

Hi, I believe I did not.
In my particular case I switched to having one full-size listener on parent object + manual checking of children bounding boxes against event point. In my case it worked better than simple event propgation would because in the end there was some complex stuff involved - alpha testing + radial search for closest object if no direct hit.

I see.

I have a parent node containing a horizontally aligned row of buttons that I would like to be able to scroll through. So the parent node and the buttons can listen to touch events that can implement the scrolling behavior while the buttons themselves would listen to their own click events.

However it seems like the events do not bubble properly if my touchstart triggers on a button and then the touchend attempts to trigger on the “empty part” of the parent node - the touchend would not trigger at all.

I think i’ll have to resort to doing what you did doing checks with bounding boxes of the buttons, tedious as it sounds. Thanks for the response!