From e99f30e6336f825134b007ffc3f4e8973ed613f7 Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Fri, 19 Dec 2025 23:44:55 -0800 Subject: [PATCH] Stop hover transfer working between rows of Properties panel dropdown menus --- frontend/src/components/layout/FloatingMenu.svelte | 7 +++++-- frontend/src/components/widgets/WidgetSection.svelte | 2 +- frontend/src/components/widgets/buttons/TextButton.svelte | 3 ++- .../components/widgets/inputs/WorkingColorsInput.svelte | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/layout/FloatingMenu.svelte b/frontend/src/components/layout/FloatingMenu.svelte index bc6112dc6..b26d6977b 100644 --- a/frontend/src/components/layout/FloatingMenu.svelte +++ b/frontend/src/components/layout/FloatingMenu.svelte @@ -372,6 +372,9 @@ // Start with the parent of the spawner for this floating menu and keep widening the search for any other valid spawners that are hover-transferrable let currentAncestor = (targetSpawner && ownSpawner?.parentElement) || undefined; while (currentAncestor) { + // If the current ancestor blocks hover transfer, stop searching + if (currentAncestor.hasAttribute("data-block-hover-transfer")) break; + const ownSpawnerDepthFromCurrentAncestor = ownSpawner && getDepthFromAncestor(ownSpawner, currentAncestor); const currentAncestor2 = currentAncestor; // This duplicate variable avoids an ESLint warning @@ -382,8 +385,8 @@ const notOurself = !ownDescendantMenuSpawners.includes(item); // And filter away unequal depths from the current ancestor const notUnequalDepths = notOurself && getDepthFromAncestor(item, currentAncestor2) === ownSpawnerDepthFromCurrentAncestor; - // And filter away elements that explicitly disable hover transfer - return notUnequalDepths && !(item as HTMLElement).getAttribute?.("data-floating-menu-spawner")?.includes("no-hover-transfer"); + // And filter away descendants that explicitly disable hover transfer + return notUnequalDepths && !(item instanceof HTMLElement && item.hasAttribute("data-block-hover-transfer")); }); // If none were found, widen the search by a level and keep trying (or stop looping if the root was reached) diff --git a/frontend/src/components/widgets/WidgetSection.svelte b/frontend/src/components/widgets/WidgetSection.svelte index c9964c74a..c51e72428 100644 --- a/frontend/src/components/widgets/WidgetSection.svelte +++ b/frontend/src/components/widgets/WidgetSection.svelte @@ -59,7 +59,7 @@ /> {#if expanded} - + {#each widgetData.layout as layoutGroup} {#if isWidgetSpanRow(layoutGroup)} diff --git a/frontend/src/components/widgets/buttons/TextButton.svelte b/frontend/src/components/widgets/buttons/TextButton.svelte index 94de4b2f5..86608e3d9 100644 --- a/frontend/src/components/widgets/buttons/TextButton.svelte +++ b/frontend/src/components/widgets/buttons/TextButton.svelte @@ -72,7 +72,8 @@ data-disabled={disabled || undefined} data-text-button tabindex={disabled ? -1 : 0} - data-floating-menu-spawner={menuListChildrenExists ? "" : "no-hover-transfer"} + data-floating-menu-spawner + data-block-hover-transfer={menuListChildrenExists ? undefined : ""} on:click={onClick} > {#if icon} diff --git a/frontend/src/components/widgets/inputs/WorkingColorsInput.svelte b/frontend/src/components/widgets/inputs/WorkingColorsInput.svelte index cff3beacb..051f9367a 100644 --- a/frontend/src/components/widgets/inputs/WorkingColorsInput.svelte +++ b/frontend/src/components/widgets/inputs/WorkingColorsInput.svelte @@ -37,7 +37,7 @@ - + (primaryOpen = detail)} @@ -47,7 +47,7 @@ /> - + (secondaryOpen = detail)}