diff --git a/web/src/lib/components/elements/dropdown.svelte b/web/src/lib/components/elements/dropdown.svelte index 6bf9b55d65..b69b191f25 100644 --- a/web/src/lib/components/elements/dropdown.svelte +++ b/web/src/lib/components/elements/dropdown.svelte @@ -15,8 +15,12 @@ import { fly } from 'svelte/transition'; import { createEventDispatcher } from 'svelte'; + let className = ''; + export { className as class }; + const dispatch = createEventDispatcher<{ select: T; + 'click-outside': void; }>(); export let options: T[]; @@ -36,6 +40,8 @@ if (!controlable) { showMenu = false; } + + dispatch('click-outside'); }; const handleSelectOption = (option: T) => { @@ -76,7 +82,7 @@ {#if showMenu}