What's wrong with Olaf's answer? preventDefault() should only work on cancelable events, and in theory if I remember the spec corrrectly, click is not cancelable. The other listeners must also check isDefaultPrevented().
stopPropagation and stopImmediatePropagation are intended to keep other listeners from even getting called. We want stopProp and stopImmedateProp to work in Royale so if it doesn't, it needs to be fixed. I think the full answer to your scenario is to use capture phase and call stopProp. My 2 cents, -Alex On 1/7/19, 7:22 AM, "Harbs" <harbs.li...@gmail.com> wrote: The only way I see of preventing the event from firing is to abort fireListenerOverride in HTMLElementWrapper. I can set defaultPrevented by attaching an event listener to the element in the constructor of my class. The question is whether we should abort the event dispatching if the event is defaultPrevented. In short, we can solve this problem by adding to the beginning of HTMLElementWrapper.fireListenerOverride: if(eventObject.defaultPrevented)return false; The question is whether this is something we should be doing. I have no other ideas of how to solve this problem. Harbs > On Jan 7, 2019, at 4:37 PM, Olaf Krueger <m...@olafkrueger.net> wrote: > > What's about setting up a default handler which always handles the click > event. > Depending on your conditions, maybe calling stopPropagation() or > stopImmediatePropagation() will prevent further propagation? > > Maybe this helps, > Olaf > > > > -- > Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-royale-development.20373.n8.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C6701c5cf1ec84c93592008d674b3ff28%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636824713784402779&sdata=LgEP5%2BK2c6iu2JaOcwqwB88NfdRxJrhDf52iICsOJcQ%3D&reserved=0