From 1fc1bf5f0d21094e947f16a402f1aca52935de23 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 6 Oct 2024 22:09:58 -0700 Subject: [PATCH] refac: floating buttons behaviour --- src/lib/components/chat/Messages/ContentRenderer.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Messages/ContentRenderer.svelte b/src/lib/components/chat/Messages/ContentRenderer.svelte index 0aede00652..f0660d5230 100644 --- a/src/lib/components/chat/Messages/ContentRenderer.svelte +++ b/src/lib/components/chat/Messages/ContentRenderer.svelte @@ -27,7 +27,10 @@ await tick(); // Check if the event target is within the content container - if (!contentContainerElement?.contains(event.target)) return; + if (!contentContainerElement?.contains(event.target)) { + closeFloatingButtons(); + return; + } let selection = window.getSelection();