From 6c9ea9f7f4895758a356d442b4a0df233f93fdeb Mon Sep 17 00:00:00 2001 From: ben-basten <45583362+ben-basten@users.noreply.github.com> Date: Sun, 13 Oct 2024 23:06:15 -0400 Subject: [PATCH] wip: recalculate position when the title changes --- .../components/elements/buttons/circle-icon-button.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/lib/components/elements/buttons/circle-icon-button.svelte b/web/src/lib/components/elements/buttons/circle-icon-button.svelte index 9b8fea2978..732ebc9dfb 100644 --- a/web/src/lib/components/elements/buttons/circle-icon-button.svelte +++ b/web/src/lib/components/elements/buttons/circle-icon-button.svelte @@ -84,6 +84,7 @@ $: colorClass = colorClasses[color]; $: mobileClass = hideMobile ? 'hidden sm:flex' : ''; $: paddingClass = paddingClasses[padding]; + $: recalculatePosition(title); const id = $$restProps.id ?? generateId(); @@ -124,6 +125,12 @@ left = box.left + box.width / 2 - offsetWidth / 2; }); }; + + const recalculatePosition = (title: string) => { + if (showPopover && title) { + onShowPopover(); + } + };