mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-29 00:06:36 +00:00
Do not try to highlight suggestion if current value is empty, resolves #434
Prevents inserting strong tag after each character when input value is empty.
This commit is contained in:
parent
fef68b6e4c
commit
e572acf56f
@ -127,6 +127,11 @@
|
|||||||
$.Autocomplete = Autocomplete;
|
$.Autocomplete = Autocomplete;
|
||||||
|
|
||||||
Autocomplete.formatResult = function (suggestion, currentValue) {
|
Autocomplete.formatResult = function (suggestion, currentValue) {
|
||||||
|
// Do not replace anything if there current value is empty
|
||||||
|
if (!currentValue) {
|
||||||
|
return suggestion.value;
|
||||||
|
}
|
||||||
|
|
||||||
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
|
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
|
||||||
|
|
||||||
return suggestion.value
|
return suggestion.value
|
||||||
|
Loading…
Reference in New Issue
Block a user