From deaf7dad9011acf2b3dab3eb579c0a4e6b0d0f28 Mon Sep 17 00:00:00 2001 From: Zachary Stence Date: Fri, 12 Jul 2024 14:13:13 -0500 Subject: [PATCH 1/2] fix: use select function instead of broken selectArray function in dropdown --- .../atoms/inputs/dropdown/dropdownOptionStore.js | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/dropdownOptionStore.js b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/dropdownOptionStore.js index 80f9b4af78..30a4ef5702 100644 --- a/packages/ui/core-components/src/lib/atoms/inputs/dropdown/dropdownOptionStore.js +++ b/packages/ui/core-components/src/lib/atoms/inputs/dropdown/dropdownOptionStore.js @@ -191,20 +191,6 @@ export const dropdownOptionStore = (multi = false, delay = 100) => { } }, delay); - /** - * @param {DropdownValue[]} opts - */ - const selectArray = (opts) => { - if (!opts || !opts.length) return; - options.update(($options) => { - $options = $options.map(($opt) => { - if (opts.includes($opt)) $opt.selected = !$opt.selected; - return $opt; - }); - return hygiene($options); - }); - }; - /** * @param {DropdownValue} opt */ @@ -274,7 +260,7 @@ export const dropdownOptionStore = (multi = false, delay = 100) => { flagOptionSharedPromise.promise ]); cleanRemoveOnSelects(selectOptions, get(options)); - selectArray(selectOptions); + selectOptions.map((o) => select(o)); }, delay), deselectAll: (autoOnly = false) => { cleanRemoveOnSelects(get(selectedOptions), get(options)); From a2f9bfb7ab86c42b4b95a8c85c24f2f3ee70a864 Mon Sep 17 00:00:00 2001 From: Zachary Stence Date: Fri, 12 Jul 2024 14:13:49 -0500 Subject: [PATCH 2/2] chore: changeset --- .changeset/fuzzy-deers-yawn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fuzzy-deers-yawn.md diff --git a/.changeset/fuzzy-deers-yawn.md b/.changeset/fuzzy-deers-yawn.md new file mode 100644 index 0000000000..51e76299f7 --- /dev/null +++ b/.changeset/fuzzy-deers-yawn.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/core-components': patch +--- + +Fix dropdown selection