2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-09-19 16:59:01 +00:00

Merge pull request #251 from freax/auto-select-first-fix

Fix for scroll on autoselect first item
This commit is contained in:
Tomas Kirda 2014-10-06 15:49:26 -05:00
commit 75879a89c1

View File

@ -669,21 +669,21 @@
noSuggestionsContainer.detach();
container.html(html);
// Select first value by default:
if (options.autoSelectFirst) {
that.selectedIndex = 0;
container.children().first().addClass(classSelected);
}
if ($.isFunction(beforeRender)) {
beforeRender.call(that.element, container);
}
that.fixPosition();
container.show();
that.visible = true;
// Select first value by default:
if (options.autoSelectFirst) {
that.selectedIndex = 0;
container.scrollTop(0);
container.children().first().addClass(classSelected);
}
that.visible = true;
that.findBestHint();
},