Skip to content

Commit

Permalink
Autocomplete accepting suggestionMatch none (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaguasta authored and javivelasco committed Apr 2, 2017
1 parent 4ff1cc9 commit b75214c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/autocomplete/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const factory = (Chip, Input) => {
showSelectedWhenNotInSource: PropTypes.bool,
showSuggestionsWhenValueIsSet: PropTypes.bool,
source: PropTypes.any,
suggestionMatch: PropTypes.oneOf(['disabled', 'start', 'anywhere', 'word']),
suggestionMatch: PropTypes.oneOf(['disabled', 'start', 'anywhere', 'word', 'none']),
theme: PropTypes.shape({
active: PropTypes.string,
autocomplete: PropTypes.string,
Expand Down Expand Up @@ -254,6 +254,8 @@ const factory = (Chip, Input) => {
} else if (suggestionMatch === 'word') {
const re = new RegExp(`\\b${query}`, 'g');
return re.test(value);
}else if(suggestionMatch === 'none'){
return value
}

return false;
Expand Down

0 comments on commit b75214c

Please sign in to comment.