Skip to content

Commit af70d37

Browse files
author
Jao Zafra
committed
The code evaluates to 0 or 1 which are both true.
Unfortunately, javascript is evaluating if(0) as false making the code inside the statement never fire. inArray returns -1 if the value is not found in the array. So I just added >= 0 for the code to fire properly.
1 parent 929f57d commit af70d37

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/assets/javascripts/autocomplete-rails-uncompressed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
options[key] = attrVal ? attrVal : value;
8080
}
8181
});
82-
if(arguments[0].length == 0 && jQuery.inArray(options.showNoMatches, [true, 'true'])) {
82+
if(arguments[0].length == 0 && jQuery.inArray(options.showNoMatches, [true, 'true']) >= 0) {
8383
arguments[0] = [];
8484
arguments[0][0] = { id: "", label: options.noMatchesLabel };
8585
}

lib/assets/javascripts/autocomplete-rails.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)