From 3afc0835d40fab0ecc3630c9317e0e127ecb03d0 Mon Sep 17 00:00:00 2001 From: Jojo Ortiz Date: Tue, 21 Nov 2023 16:50:36 -0800 Subject: [PATCH] add funtionality to close dropdown after outside click --- .../lib/Chatbots/Components/Dropdown.svelte | 9 ++++++++- pykoi/frontend/src/utils.js | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte b/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte index a9dee91..1855c12 100644 --- a/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte +++ b/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte @@ -3,6 +3,7 @@ import { checkedDocs } from "../../../store"; import { selectAll } from "d3-selection"; import { tooltip } from "../../../utils.js"; + import { clickOutside } from "../../../utils.js"; export let documents = []; @@ -44,12 +45,18 @@ return text; } + function handleClickOutside(e) { + e.preventDefault(); + console.log('click outside'); + expanded = false; + } + $: console.log($checkedDocs);
-
+