Skip to content

Commit

Permalink
Merge pull request #3316 from JedWatson/tavareshenrique-fix_creatable
Browse files Browse the repository at this point in the history
rebase of master onto #3275
  • Loading branch information
gwyneplaine authored Jan 3, 2019
2 parents 2ce511a + d2806cc commit 5094666
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Creatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ export type CreatableProps = {

export type Props = SelectProps & CreatableProps;

const compareOption = (inputValue, option) => {
const candidate = inputValue.toLowerCase();
return (
option.value.toLowerCase() === candidate ||
option.label.toLowerCase() === candidate
);
const compareOption = (inputValue = '', option) => {
const candidate = String(inputValue).toLowerCase();
const optionValue = String(option.value).toLowerCase();
const optionLabel = String(option.label).toLowerCase();
return optionValue === candidate || optionLabel === candidate;
};

const builtins = {
Expand Down

0 comments on commit 5094666

Please sign in to comment.