Autocomplete accepting suggestionMatch none (#1289)
parent
4ff1cc9734
commit
b75214c792
|
@ -40,7 +40,7 @@ const factory = (Chip, Input) => {
|
||||||
showSelectedWhenNotInSource: PropTypes.bool,
|
showSelectedWhenNotInSource: PropTypes.bool,
|
||||||
showSuggestionsWhenValueIsSet: PropTypes.bool,
|
showSuggestionsWhenValueIsSet: PropTypes.bool,
|
||||||
source: PropTypes.any,
|
source: PropTypes.any,
|
||||||
suggestionMatch: PropTypes.oneOf(['disabled', 'start', 'anywhere', 'word']),
|
suggestionMatch: PropTypes.oneOf(['disabled', 'start', 'anywhere', 'word', 'none']),
|
||||||
theme: PropTypes.shape({
|
theme: PropTypes.shape({
|
||||||
active: PropTypes.string,
|
active: PropTypes.string,
|
||||||
autocomplete: PropTypes.string,
|
autocomplete: PropTypes.string,
|
||||||
|
@ -254,6 +254,8 @@ const factory = (Chip, Input) => {
|
||||||
} else if (suggestionMatch === 'word') {
|
} else if (suggestionMatch === 'word') {
|
||||||
const re = new RegExp(`\\b${query}`, 'g');
|
const re = new RegExp(`\\b${query}`, 'g');
|
||||||
return re.test(value);
|
return re.test(value);
|
||||||
|
}else if(suggestionMatch === 'none'){
|
||||||
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue