From 9e5d39e3ff0c552ac7a629982e010e61a91c2b61 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Wed, 26 Oct 2022 13:48:48 +0100 Subject: [PATCH] Fix Input Dropdown Outside Click (#8404) --- packages/bbui/src/Form/Core/InputDropdown.svelte | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/bbui/src/Form/Core/InputDropdown.svelte b/packages/bbui/src/Form/Core/InputDropdown.svelte index 8865ee3ddc..944d79655d 100644 --- a/packages/bbui/src/Form/Core/InputDropdown.svelte +++ b/packages/bbui/src/Form/Core/InputDropdown.svelte @@ -102,6 +102,13 @@ } return value } + + const handleOutsideClick = event => { + if (open) { + event.stopPropagation() + open = false + } + }
@@ -168,7 +175,7 @@ {#if open}
(open = false)} + use:clickOutside={handleOutsideClick} transition:fly|local={{ y: -20, duration: 200 }} class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open" >