fix: flatten slot context menu to avoid submenu overflow clipping

Amp-Thread-ID: https://ampcode.com/threads/T-019c3a65-ccea-72d8-855c-0d55837a3d13
This commit is contained in:
bymyself
2026-02-08 12:57:19 -08:00
parent f93a82abc8
commit c003930f0d

View File

@@ -6,13 +6,9 @@
@show="onMenuShow"
@hide="onMenuHide"
>
<template #item="{ item, props: itemProps, hasSubmenu }">
<template #item="{ item, props: itemProps }">
<a v-bind="itemProps.action" class="flex items-center gap-2 px-3 py-1.5">
<span class="flex-1">{{ item.label }}</span>
<i
v-if="hasSubmenu"
class="icon-[lucide--chevron-right] size-4 opacity-60"
/>
</a>
</template>
</ContextMenu>
@@ -97,16 +93,15 @@ const menuItems = computed<MenuItem[]>(() => {
}
return [
{
label: 'Connect to...',
items: targets.map((target) => ({
label: `${target.slotInfo.name} @ ${target.node.title || target.node.type}`,
command: () => {
connectSlots(ctx, target)
hide()
}
}))
}
{ label: 'Connect to...', disabled: true },
{ separator: true },
...targets.map((target) => ({
label: `${target.slotInfo.name} @ ${target.node.title || target.node.type}`,
command: () => {
connectSlots(ctx, target)
hide()
}
}))
]
})