I've set up this menu. Then, I have the methods openMenu, closeMenu and clickMenu.
<li class="nav-item dropdown"
v-on:mouseenter="openMenu"
v-on:mouseleave="closeMenu"
v-on:click="clickMenu">
<a href="#demo" class="nav-link dropdown-toggle">DEMO</a>
<ul class="dropdown-menu">
<li class="dropdown-item"><a href="#">Demo 1</a></li>
<li class="dropdown-item"><a href="#">Demo 2</a></li>
</ul>
</li>
When I investigated what's going on, I noticed that clicking and mousing the main menu works as expected to. However, it seems that the anchors from the submenu also react to a click event. I haven't set any listeners to them in other locations. In fact, when I remove the @click
form the top one, the submenus stop registering a click.
So it's definitely that the daddy menu spreads the even listening to the children! So unexpected...
Then, I tried the other events. And wouldn't you know? Those behave exactly as expected. No spreading of the hovering event at all.
Is this a bug? How to report it?
(If it's a feature then it's one of the most stupid ones ever.)
I know it doesn't matter but I can bet my donkey that someone as stunned as me will assume it's something super basic and ask for the code to the scripts. The issue is not there but since I'm such a flexible guy, here it is.
methods: {
openMenu: (event) => { debugger; },
closeMenu: (event) => { debugger; },
clickMenu: (event) => { debugger; }
}