Skip to content

Commit 4eb79fc

Browse files
committed
Differentiate between a minCharacters of 0 and undefined.
The comment at line 65 implies that setting minCharacters to 0 will result in no matches being displayed when there are no characters in the search box (e.g. if you've backspaced your search term). The code was treating 'undefined' and 0 identically.
1 parent 39b877c commit 4eb79fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jquery.ui.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
* @return container (which should be positioned and visible)
137137
*/
138138
updateList: function(unfilteredList, val) {
139-
if (opt.minCharacters && val.length <= opt.minCharacters) {
139+
if (typeof opt.minCharacters !== 'undefined' && val.length <= opt.minCharacters) {
140140
return false;
141141
}
142142

0 commit comments

Comments
 (0)