From b91bc43929db7adc97267b3a6ba9262435c1f2f4 Mon Sep 17 00:00:00 2001 From: anton-github Date: Mon, 11 Dec 2017 11:23:37 +0500 Subject: [PATCH] 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. --- src/jquery.autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 2e4dcc7..173ac5e 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -859,7 +859,7 @@ } 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.ignoreValueChange = false; that.el.val(that.currentValue);