2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-22 12:55: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", "name": "devbridge-autocomplete",
"version": "1.4.11", "version": "1.4.13",
"homepage": "https://github.com/devbridge/jQuery-Autocomplete", "homepage": "https://github.com/devbridge/jQuery-Autocomplete",
"authors": [ "authors": [
"Tomas Kirda" "Tomas Kirda"

View File

@ -6,7 +6,7 @@
"ajax", "ajax",
"autocomplete" "autocomplete"
], ],
"version": "1.4.11", "version": "1.4.13",
"author": { "author": {
"name": "Tomas Kirda", "name": "Tomas Kirda",
"url": "https://github.com/tkirda" "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 * (c) 2017 Tomas Kirda
* *
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license. * Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
@ -226,7 +226,7 @@
that.fixPosition(); 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(); that.onValueChange();
} }
}, },
@ -493,7 +493,7 @@
return; return;
} }
if (query.trim().length < options.minChars) { if (query.replace(/[^A-Z0-9]/ig, '').length < options.minChars) {
that.hide(); that.hide();
} else { } else {
that.getSuggestions(query); that.getSuggestions(query);

File diff suppressed because one or more lines are too long

View File

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

View File

@ -226,7 +226,7 @@
that.fixPosition(); 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(); that.onValueChange();
} }
}, },
@ -493,7 +493,7 @@
return; return;
} }
if (query.trim().length < options.minChars) { if (query.replace(/[^A-Z0-9]/ig, '').length < options.minChars) {
that.hide(); that.hide();
} else { } else {
that.getSuggestions(query); that.getSuggestions(query);