I have an issue with nested divs both having onmouseover/onmouseout event. I have a nav menu which pops open from the side of the screen triggered by an onmouseover event. Inside this nav menu, I have a submenu which pops open which is also triggered by an onmouseover event. Both opening events work fine independently, but when run together, the trigger seems to get intercepted the outer div (the outer div opens but the inner div does nothing).
- I have tried adding @onmouseover:stopPropagation="true" on both the parent and the child div, but this hasn't made any effect.
- I'm aware that there is talk of onmouseenter/onmouseleave in a similar way to html/js in Blazor 5, but November is a long way off and support is still up in the air.
If there's a trick I've missed please let me know. code is below (c# code omitted - just modifies the collapseNavicationFlag and ExpandSubmenu flag strings accordingly.)
Nav menu
<div id="nav-bar" class="@collapseNavigationFlag" @onmouseover="ExpandNavigation" @onmouseout="CollapseNavigation">
<div>
<ul class="nav flex-column">
foreach (var navigationItem in navigationSection.NavigationItems)
{
<NavMenuSubmenu />
}
</ul>
</div>
NavMenuSubmenu
<li>
<ul class="nav-submenu @expandSubmenu"
@onmouseover="ExpandSubmenu"
@onmouseout="CollapseSubmenu">
@foreach (var navigationSubItem in NavigationItem.NavigationSubItems)
{
<li class="nav-submenu-item px-3">
<a href="@navigationSubItem.Page">
@navigationSubItem.Title
</a>
</li>
}
</ul>
</li>