Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from reaviz/fix-createable
Browse files Browse the repository at this point in the history
Fixing a weird issue with the createable select
  • Loading branch information
amcdnl authored Oct 9, 2022
2 parents d4c27d5 + 494fa4f commit cee69bb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,9 @@ export const Select: FC<Partial<SelectProps>> = ({

if (index > -1 || createable) {
const newSelection = {
value: createable ? result[index]?.value : inputValue,
children: createable ? result[index]?.value : inputValue,
value: createable && result[index] ? result[index].value : inputValue,
children:
createable && result[index] ? result[index].value : inputValue
};

toggleSelectedOption(newSelection);
Expand Down

0 comments on commit cee69bb

Please sign in to comment.