fix issue in search

This commit is contained in:
jimmyff 2023-02-12 19:33:45 +00:00
parent 5587f8b8cd
commit e4bb4f4c2a

View file

@ -151,6 +151,7 @@ function initSearch() {
} }
$searchResults.style.display = term === "" ? "none" : "block"; $searchResults.style.display = term === "" ? "none" : "block";
$searchResultsItems.innerHTML = ""; $searchResultsItems.innerHTML = "";
currentTerm = term;
if (term === "") { if (term === "") {
return; return;
} }
@ -161,7 +162,6 @@ function initSearch() {
return; return;
} }
currentTerm = term;
for (var i = 0; i < Math.min(results.length, MAX_ITEMS); i++) { for (var i = 0; i < Math.min(results.length, MAX_ITEMS); i++) {
var item = document.createElement("li"); var item = document.createElement("li");
item.innerHTML = formatSearchResultItem(results[i], term.split(" ")); item.innerHTML = formatSearchResultItem(results[i], term.split(" "));