diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 8be9a273..abc809ff 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -687,7 +687,8 @@ if (options.autoSelectFirst) { that.selectedIndex = 0; container.scrollTop(0); - container.children().first().addClass(classSelected); + var filter = '[data-index="' + that.selectedIndex + '"]'; + container.children().filter(filter).addClass(classSelected); } that.visible = true;