fix(Select): select clear button (#4398)
This commit is contained in:
parent
a72192da28
commit
a11cd6d6cb
@ -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]), []);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user