diff --git a/packages/bbui/src/ColorPicker/ColorPicker.svelte b/packages/bbui/src/ColorPicker/ColorPicker.svelte
index 52a877415b..331de38371 100644
--- a/packages/bbui/src/ColorPicker/ColorPicker.svelte
+++ b/packages/bbui/src/ColorPicker/ColorPicker.svelte
@@ -119,6 +119,13 @@
return "var(--spectrum-global-color-static-gray-900)"
}
+
+ const handleOutsideClick = event => {
+ if (open) {
+ event.stopPropagation()
+ open = false
+ }
+ }
@@ -131,7 +138,7 @@
{#if open}
(open = false)}
+ use:clickOutside={handleOutsideClick}
transition:fly={{ y: -20, duration: 200 }}
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
class:spectrum-Popover--align-right={alignRight}
diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte
index d80ca98153..16d13ef2cc 100644
--- a/packages/bbui/src/Form/Core/Picker.svelte
+++ b/packages/bbui/src/Form/Core/Picker.svelte
@@ -85,7 +85,7 @@
class:is-invalid={!!error}
class:is-open={open}
aria-haspopup="listbox"
- on:mousedown={onClick}
+ on:click={onClick}
>
{#if fieldIcon}