From d1cce411c813b611bef726ea0f1d37ed6a7d59e4 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 3 Aug 2022 13:47:55 +0100 Subject: [PATCH] Fix picker dropdown UX issues. Rename some usages of groups to user groups. --- .../bbui/src/Form/Core/PickerDropdown.svelte | 35 +++++++++---------- .../portal/manage/users/[userId].svelte | 6 ++-- .../_components/AssignmentModal.svelte | 3 +- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/packages/bbui/src/Form/Core/PickerDropdown.svelte b/packages/bbui/src/Form/Core/PickerDropdown.svelte index fbe43717ba..db19dab6ac 100644 --- a/packages/bbui/src/Form/Core/PickerDropdown.svelte +++ b/packages/bbui/src/Form/Core/PickerDropdown.svelte @@ -15,7 +15,6 @@ export let id = null export let placeholder = "Choose an option or type" export let disabled = false - export let readonly = false export let updateOnChange = true export let error = null export let secondaryOptions = [] @@ -50,17 +49,11 @@ } const updateValue = newValue => { - if (readonly) { - return - } dispatch("change", newValue) } const onClickSecondary = () => { dispatch("click") - if (readonly) { - return - } secondaryOpen = true } @@ -80,24 +73,15 @@ } const onBlur = event => { - if (readonly) { - return - } focus = false updateValue(event.target.value) } const onInput = event => { - if (readonly || !updateOnChange) { - return - } updateValue(event.target.value) } const updateValueOnEnter = event => { - if (readonly) { - return - } if (event.key === "Enter") { updateValue(event.target.value) } @@ -140,9 +124,10 @@ value={primaryLabel || ""} placeholder={placeholder || ""} {disabled} - {readonly} + readonly class="spectrum-Textfield-input spectrum-InputGroup-input" class:labelPadding={iconData} + class:open={primaryOpen} /> {#if primaryValue} group.name, getValue: group => group._id, @@ -97,7 +97,6 @@ {#each appData as input, index}