From a11cd6d6cbe20d7d986430befb3398f910a03ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20H=2E=20K=C3=B6hler?= Date: Tue, 1 Oct 2024 17:42:21 -0300 Subject: [PATCH] fix(Select): select clear button (#4398) --- platform/ui/src/components/Select/Select.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/ui/src/components/Select/Select.tsx b/platform/ui/src/components/Select/Select.tsx index 474edc23e..6635798b9 100644 --- a/platform/ui/src/components/Select/Select.tsx +++ b/platform/ui/src/components/Select/Select.tsx @@ -101,6 +101,9 @@ const Select = ({ }} value={value && Array.isArray(value) ? selectedOptions : value} onChange={(selectedOptions, { action }) => { + if (selectedOptions === null) { + return onChange(null, action); + } const newSelection = !selectedOptions.length ? selectedOptions : selectedOptions.reduce((acc, curr) => acc.concat([curr.value]), []);