2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-22 04:45:12 +00:00

Excludes non alphanumeric characters from minChars check

This commit is contained in:
Faisal Feroz 2023-07-27 19:55:58 +05:00
parent 1c00c94a78
commit 5aa5a69b42
7 changed files with 25 additions and 14 deletions

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jQuery-Autocomplete</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@ -1,6 +1,6 @@
{
"name": "devbridge-autocomplete",
"version": "1.4.11",
"version": "1.4.13",
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
"authors": [
"Tomas Kirda"

View File

@ -6,7 +6,7 @@
"ajax",
"autocomplete"
],
"version": "1.4.11",
"version": "1.4.13",
"author": {
"name": "Tomas Kirda",
"url": "https://github.com/tkirda"

View File

@ -1,5 +1,5 @@
/**
* Ajax Autocomplete for jQuery, version 1.4.11
* Ajax Autocomplete for jQuery, version 1.4.13
* (c) 2017 Tomas Kirda
*
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
@ -226,7 +226,7 @@
that.fixPosition();
if (that.el.val().trim().length >= that.options.minChars) {
if (that.el.val().replace(/[^A-Z0-9]/ig, '').length >= that.options.minChars) {
that.onValueChange();
}
},
@ -493,7 +493,7 @@
return;
}
if (query.trim().length < options.minChars) {
if (query.replace(/[^A-Z0-9]/ig, '').length < options.minChars) {
that.hide();
} else {
that.getSuggestions(query);
@ -776,7 +776,7 @@
var that = this,
onHintCallback = that.options.onHint,
hintValue = '';
if (suggestion) {
hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length);
}
@ -786,7 +786,7 @@
if ($.isFunction(onHintCallback)) {
onHintCallback.call(that.element, hintValue);
}
}
}
},
verifySuggestionsFormat: function (suggestions) {

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "devbridge-autocomplete",
"version": "1.4.11",
"version": "1.4.13",
"description": "Autocomplete provides suggestions while you type into the text field.",
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
"author": "Tomas Kirda (https://twitter.com/tkirda)",

View File

@ -226,7 +226,7 @@
that.fixPosition();
if (that.el.val().trim().length >= that.options.minChars) {
if (that.el.val().replace(/[^A-Z0-9]/ig, '').length >= that.options.minChars) {
that.onValueChange();
}
},
@ -493,7 +493,7 @@
return;
}
if (query.trim().length < options.minChars) {
if (query.replace(/[^A-Z0-9]/ig, '').length < options.minChars) {
that.hide();
} else {
that.getSuggestions(query);
@ -776,7 +776,7 @@
var that = this,
onHintCallback = that.options.onHint,
hintValue = '';
if (suggestion) {
hintValue = that.currentValue + suggestion.value.substr(that.currentValue.length);
}
@ -786,7 +786,7 @@
if ($.isFunction(onHintCallback)) {
onHintCallback.call(that.element, hintValue);
}
}
}
},
verifySuggestionsFormat: function (suggestions) {