Skip to content

Commit

Permalink
πŸ› fix(onSelectOption) isNewInput always false
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
anubra266 committed May 31, 2021
1 parent 8222036 commit e7a237a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions example/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ const App = () => {
openOnFocus
creatable
defaultIsOpen
onSelectOption={({ optionValue }) => {
console.log('wow :>> ', optionValue);
onSelectOption={({ optionValue, isNewInput }) => {
console.log('wow :>> ', optionValue, isNewInput);
return false;
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/autocomplete-props/onSelectOption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const runOnSelect = (
runIfFn(onSelectOption, {
optionValue: activeItem.value,
selectMethod,
isNewInput: activeItem.key === 'isNewInput',
isNewInput: activeItem.key === 'newInput',
});

if (
Expand Down

0 comments on commit e7a237a

Please sign in to comment.