2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-22 04:45:12 +00:00

Update jquery.autocomplete.js

We have to remove class from first suggestion element, not from every first children. Otherwise, in case of a grouped list, first item never lose selected state.
This commit is contained in:
anton-github 2017-12-11 11:23:37 +05:00 committed by GitHub
parent 50a7d9b130
commit b91bc43929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -859,7 +859,7 @@
} }
if (that.selectedIndex === 0) { if (that.selectedIndex === 0) {
$(that.suggestionsContainer).children().first().removeClass(that.classes.selected); $(that.suggestionsContainer).children('.' + that.classes.suggestion).first().removeClass(that.classes.selected);
that.selectedIndex = -1; that.selectedIndex = -1;
that.ignoreValueChange = false; that.ignoreValueChange = false;
that.el.val(that.currentValue); that.el.val(that.currentValue);