fix(Select): select clear button (#4398)
This commit is contained in:
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]), []);
|
||||
|
||||
Reference in new issue
Block a user