fix: Click event of menuparent unexpectedly goes to underlying element

This commit is contained in:
Lhcfl 2024-05-05 18:31:27 +08:00
parent d114b8ec1d
commit 4d2621a570

View file

@ -130,7 +130,7 @@
v-else-if="item.type === 'parent'"
class="_button item parent"
:class="{ childShowing: childShowingItem === item }"
@mouseenter="showChildren(item, $event)"
@mouseenter.passive="showChildren(item, $event)"
@click.stop="showChildren(item, $event)"
>
<i
@ -318,6 +318,7 @@ function onItemMouseLeave(_item) {
async function showChildren(item: MenuParent, ev: MouseEvent) {
if (props.asDrawer) {
if (ev.type === "mouseenter") return;
os.popupMenu(item.children, (ev.currentTarget ?? ev.target) as HTMLElement);
close();
} else {