From 024e93b021a0e54629205593f5751d55e4111727 Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 26 Sep 2024 10:40:19 -0500 Subject: [PATCH] fix: defer selectAll --- .changeset/twenty-squids-mate.md | 5 +++++ .../src/lib/atoms/inputs/dropdown/dropdownOptionStore.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/twenty-squids-mate.md diff --git a/.changeset/twenty-squids-mate.md b/.changeset/twenty-squids-mate.md new file mode 100644 index 0000000000..aa07f19003 --- /dev/null +++ b/.changeset/twenty-squids-mate.md @@ -0,0 +1,5 @@ +--- +'@evidence-dev/core-components': patch +--- + +Defer selectAll=false to ensure that all options are available before the behavior is turned off 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 562c2e9e0e..411efdf9c5 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 @@ -142,7 +142,10 @@ export const dropdownOptionStore = (opts = {}) => { }); return $options; }); - selectAll = false; + setTimeout(() => { + // defer to end of event loop + selectAll = false; + }, 0); }, 100 )