Skip to content

Commit

Permalink
Merge pull request #2212 from evidence-dev/next
Browse files Browse the repository at this point in the history
patch release
  • Loading branch information
mcrascal authored Jul 12, 2024
2 parents 6454aef + 1f2f2d7 commit 472d7b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-deers-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@evidence-dev/core-components': patch
---

Fix dropdown selection
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 472d7b7

Please sign in to comment.