autocomplete: fix empty autocomplete calls when toggling related tags.
This happens because toggling a related tag updates the tag box, which triggers autocomplete, which can't find a tag because the cursor isn't in the tag box, so it ends up making an autocomplete call for the empty string.
This commit is contained in:
@@ -199,6 +199,10 @@ Autocomplete.render_item = function(list, item) {
|
||||
};
|
||||
|
||||
Autocomplete.autocomplete_source = function(query, type) {
|
||||
if (query === "") {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $.getJSON("/autocomplete.json", {
|
||||
"search[query]": query,
|
||||
"search[type]": type,
|
||||
|
||||
Reference in New Issue
Block a user