Skip to content

Commit e50d672

Browse files
fix fail with standart version
1 parent 8c68588 commit e50d672

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/autocomplete.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,11 @@ class AutoComplete {
297297

298298
var params = this;
299299
Array.prototype.forEach.call(this.DOMResults.getElementsByTagName("li"), function(li) {
300-
li.onclick = function(event) {
301-
params._Select(li);
302-
};
300+
if (li.getAttribute("class") != "locked") {
301+
li.onclick = function(event) {
302+
params._Select(li);
303+
};
304+
}
303305
});
304306
},
305307

@@ -326,6 +328,7 @@ class AutoComplete {
326328
if (response.length > 0) {
327329
this.DOMResults.innerHTML = response;
328330
} else {
331+
li.innerHTML = this.EmptyMessage;
329332
li.setAttribute("class", "locked");
330333
ul.appendChild(li);
331334
}
@@ -481,7 +484,9 @@ class AutoComplete {
481484
}
482485

483486
params.Input = input;
484-
}
487+
} else {
488+
params.Input = element;
489+
}
485490

486491
if (params.Input.nodeName.match(/^INPUT$/i) && params.Input.getAttribute("type").match(/^TEXT|SEARCH$/i)) {
487492
params.Input.setAttribute("autocomplete", "off");

0 commit comments

Comments
 (0)