I mean that click events from the underlying HTML element automatically fire 
from the Royale UIBase.

I have a button which pops up a menu when held for a second. If you release the 
mouse over the button after the menu pops up, the browser fires a click event. 
I only want a click event if there’s no menu visible.

I tried preventDefault, and it didn’t seem to help.
I even tried adding the event listener to the capture phase but that didn’t 
work either.

Thanks,
Harbs

> On Jan 7, 2019, at 4:17 PM, Piotr Zarzycki <piotrzarzyck...@gmail.com> wrote:
> 
> Hi Harbs,
> 
> I did something like that lately, but it is not what I wanted to figure out
> how to achieve in Royale.
> 
> element.addEventListener('click', function(event:Event):Boolean {
>                event.preventDefault();
>                return false;
>            });
> 
> By prevent you mean do not propagate actually ?
> 
> Thanks, Piotr
> 
> pon., 7 sty 2019 o 15:07 Harbs <harbs.li...@gmail.com> napisał(a):
> 
>> I have a component where I want to prevent the element click event from
>> firing from the component under certain conditions.
>> 
>> I’m struggling on how to best accomplish that.
>> 
>> Harbs
> 
> 
> 
> -- 
> 
> Piotr Zarzycki
> 
> Patreon: *https://www.patreon.com/piotrzarzycki
> <https://www.patreon.com/piotrzarzycki>*

Reply via email to