Skip to content

Commit

Permalink
fix(Select): select clear button (#4398)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokohler authored Oct 1, 2024
1 parent a72192d commit a11cd6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions platform/ui/src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]), []);
Expand Down

0 comments on commit a11cd6d

Please sign in to comment.