Skip to content

Commit 1c00c94

Browse files
author
Faisal Feroz
committed
Empty input (all spaces) isn't counted in minChars
1 parent 8138252 commit 1c00c94

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
/*.xml
66
/bower_components
77
/node_modules/*
8+
.DS_Store
9+
package-lock.json

dist/jquery.autocomplete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226

227227
that.fixPosition();
228228

229-
if (that.el.val().length >= that.options.minChars) {
229+
if (that.el.val().trim().length >= that.options.minChars) {
230230
that.onValueChange();
231231
}
232232
},
@@ -493,7 +493,7 @@
493493
return;
494494
}
495495

496-
if (query.length < options.minChars) {
496+
if (query.trim().length < options.minChars) {
497497
that.hide();
498498
} else {
499499
that.getSuggestions(query);

0 commit comments

Comments
 (0)