From 624817bdc1ba410307e5986ebacef13ce8bd82b6 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 25 Oct 2024 15:21:56 +0200 Subject: [PATCH] also call onToggle on open changed (#33813) fixes: #31415 Signed-off-by: Erik Jan de Wit --- js/libs/ui-shared/src/select/SingleSelect.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/libs/ui-shared/src/select/SingleSelect.tsx b/js/libs/ui-shared/src/select/SingleSelect.tsx index b635c0ab3e..2087e817c6 100644 --- a/js/libs/ui-shared/src/select/SingleSelect.tsx +++ b/js/libs/ui-shared/src/select/SingleSelect.tsx @@ -55,7 +55,9 @@ export const SingleSelect = ({ }} {...props} onClick={toggle} - onOpenChange={(isOpen) => setOpen(isOpen)} + onOpenChange={(isOpen) => { + if (isOpen !== open) toggle(); + }} selected={selections} onSelect={(_, value) => { onSelect?.(value || "");