Skip to content

Commit

Permalink
Add itemToString to MultiSelect
Browse files Browse the repository at this point in the history
This fixes a flash of `[object Object]` before the input is cleared
after selecting an item
  • Loading branch information
nihaals committed Mar 28, 2021
1 parent c7683a7 commit 57d6445
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions thunderstore-components/src/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export const MultiSelect = <T extends SelectOption = SelectOption>({
defaultHighlightedIndex: 0,
selectedItem: null,
items: filteredOptions,
itemToString: (option) => option?.label || "",
stateReducer: (_, actionAndChanges) => {
const { changes, type } = actionAndChanges;
switch (type) {
Expand Down

0 comments on commit 57d6445

Please sign in to comment.