diff --git a/frontend/src/lib/components/home/CreateActionsMenu.svelte b/frontend/src/lib/components/home/CreateActionsMenu.svelte index 49ff2bad87..7c5bb4986e 100644 --- a/frontend/src/lib/components/home/CreateActionsMenu.svelte +++ b/frontend/src/lib/components/home/CreateActionsMenu.svelte @@ -362,6 +362,16 @@ // only persist the non-default (hidden) state, so a cleared key means "shown" storeLocalSetting(SHOW_DOC_SETTING, value ? undefined : 'false') } + // The pointer crosses the gutter outside the menu on its way into the Workflow-as-Code + // submenu, so leaving the menu keeps the panel while that submenu is open; it clears + // once the submenu closes with neither pointer nor focus left on the menu. + let menuEl: HTMLDivElement | undefined = $state(undefined) + $effect(() => { + if ($wacSubOpen || !menuEl) return + if (!menuEl.matches(':hover') && !menuEl.contains(document.activeElement)) { + activeKey = undefined + } + }) let active = $derived(allOptions.find((o) => o.key === activeKey)) let activeAc = $derived(active ? accentClasses[active.accent] : undefined) @@ -438,7 +448,10 @@ data-arrow-loop class="z-[6000] flex flex-row justify-end pointer-events-none focus:outline-none" style={showDoc ? 'width: 780px;' : ''} - onpointerleave={() => (activeKey = undefined)} + bind:this={menuEl} + onpointerleave={() => { + if (!$wacSubOpen) activeKey = undefined + }} >
{#each option.variants ?? [] as variant (variant.label)} {@const VariantIcon = variant.icon} @@ -580,7 +593,7 @@
{#each importActions as action, i (action.label)}