Skip to content

Commit b91bc43

Browse files
authored
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.
1 parent 50a7d9b commit b91bc43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@
859859
}
860860

861861
if (that.selectedIndex === 0) {
862-
$(that.suggestionsContainer).children().first().removeClass(that.classes.selected);
862+
$(that.suggestionsContainer).children('.' + that.classes.suggestion).first().removeClass(that.classes.selected);
863863
that.selectedIndex = -1;
864864
that.ignoreValueChange = false;
865865
that.el.val(that.currentValue);

0 commit comments

Comments
 (0)