mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 06:20:11 +00:00
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:
@@ -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()
|
||||
}
|
||||
}))
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user