From f9482275f25490a74978920813d16ad7aeee97d8 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 2 Mar 2024 01:20:50 -0800 Subject: [PATCH] fix: tooltip --- src/lib/components/common/Tooltip.svelte | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lib/components/common/Tooltip.svelte b/src/lib/components/common/Tooltip.svelte index fca2b0e8..62ca4eb8 100644 --- a/src/lib/components/common/Tooltip.svelte +++ b/src/lib/components/common/Tooltip.svelte @@ -10,18 +10,19 @@ $: if (tooltipElement && content) { if (tooltipInstance) { - tooltipInstance[0]?.destroy(); + tooltipInstance.setContent(content); + } else { + tooltipInstance = tippy(tooltipElement, { + content: content, + placement: placement, + allowHTML: true + }); } - tooltipInstance = tippy(tooltipElement, { - content: content, - placement: placement, - allowHTML: true - }); } onDestroy(() => { if (tooltipInstance) { - tooltipInstance[0]?.destroy(); + tooltipInstance.destroy(); } });