fix(Select): select clear button (#4398)

This commit is contained in:
Pedro H. Köhler authored and GitHub committed 2024-10-01 16:42:21 -04:00
1 parent a72192da28
commit a11cd6d6cb
1 file changed
+3
@@ -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]), []);