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

[Feature] Be able to select option with Return key #5

Merged
merged 1 commit into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,9 @@ export const Select: FC<Partial<SelectProps>> = ({
}

if (index > -1 || createable) {
const newSelection = result[index]?.value || {
value: inputValue,
children: inputValue
const newSelection = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow - this was it? Was it just passing the wrong var?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, I verified through storybook :)

value: result[index]?.value,
children: result[index]?.value
};

toggleSelectedOption(newSelection);
Expand Down