Fix bug with autocomplete showing same option more than once

Autocomplete menu had a bug that showed the same item more than once as
the user kept on typing. The issue is now fixed since the way the items
are closed is reworked and is solidly working all right.
This commit is contained in:
Deepjyoti Barman
2020-08-28 13:39:39 +05:30
parent b3c301e27a
commit d9ca19ada6

View File

@@ -97,12 +97,7 @@ function autocomplete(inp, passedValues) {
function closeAllLists(elmnt) {
/*close all autocomplete lists in the document,
except the one passed as an argument:*/
var x = document.getElementsByClassName("autocomplete-item");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i]) {
x[i].parentNode.removeChild(x[i]);
}
}
document.getElementsByClassName("autocomplete-items-container")[0].innerHTML = "";
}
/*execute a function when someone clicks in the document:*/