From b75214c7924983ad52e9723f161c03ab5384f5cd Mon Sep 17 00:00:00 2001 From: Raphael Guastaferro Date: Sun, 2 Apr 2017 09:15:26 -0300 Subject: [PATCH] Autocomplete accepting suggestionMatch none (#1289) --- components/autocomplete/Autocomplete.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/autocomplete/Autocomplete.js b/components/autocomplete/Autocomplete.js index 5920a777..458f40c1 100644 --- a/components/autocomplete/Autocomplete.js +++ b/components/autocomplete/Autocomplete.js @@ -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, @@ -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;