I have a span child in a div.
On my div I have a mouseover
event, when I hover on the span
, my event triggers.
Simple code:
<div (mouseover)="showOverlay($event, FooBar)" (mouseleave)="showOverlay($event, FooBar)">
<span>{{ someDataHere }}</span>
</div>
public showOverlay($event, op, element): void {
op.toggle($event, element);
$event.preventDefault();
}
What I want is to keep showing my overlay when on child, how do I achieve this?
mouseenter
and mouseleave
cover this use case better because entering a child doesn't mouseleave
to fire, only leaving the outside border of the actual element makes it to fire.
See also What is the difference between the mouseover and mouseenter events?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With