diff --git a/packages/bbui/src/DropdownMenu/DropdownMenu.svelte b/packages/bbui/src/DropdownMenu/DropdownMenu.svelte index d297e5e947..b3e19dbf3a 100644 --- a/packages/bbui/src/DropdownMenu/DropdownMenu.svelte +++ b/packages/bbui/src/DropdownMenu/DropdownMenu.svelte @@ -43,7 +43,8 @@ use:clickOutside={hide} style={menuStyle} on:keydown={handleEscape} - class="spectrum-Popover is-open" role="presentation"> + class="spectrum-Popover is-open" + role="presentation"> diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 1e2d6645ac..5bc0480f94 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -3,6 +3,7 @@ import "@spectrum-css/popover/dist/index-vars.css" import "@spectrum-css/menu/dist/index-vars.css" import { fly } from "svelte/transition" + import { createEventDispatcher } from "svelte" export let id = null export let disabled = false @@ -16,6 +17,16 @@ export let getOptionLabel = option => option export let getOptionValue = option => option export let open = false + export let readonly = false + + const dispatch = createEventDispatcher() + const onClick = () => { + dispatch("click") + if (readonly) { + return + } + open = true + }