Skip to content

Commit

Permalink
Empty input (all spaces) isn't counted in minChars
Browse files Browse the repository at this point in the history
  • Loading branch information
Faisal Feroz committed Oct 20, 2022
1 parent 8138252 commit 1c00c94
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/*.xml
/bower_components
/node_modules/*
.DS_Store
package-lock.json
4 changes: 2 additions & 2 deletions dist/jquery.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@

that.fixPosition();

if (that.el.val().length >= that.options.minChars) {
if (that.el.val().trim().length >= that.options.minChars) {
that.onValueChange();
}
},
Expand Down Expand Up @@ -493,7 +493,7 @@
return;
}

if (query.length < options.minChars) {
if (query.trim().length < options.minChars) {
that.hide();
} else {
that.getSuggestions(query);
Expand Down
Loading

0 comments on commit 1c00c94

Please sign in to comment.