mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-09 23:01:00 +00:00
Merge pull request #251 from freax/auto-select-first-fix
Fix for scroll on autoselect first item
This commit is contained in:
commit
75879a89c1
@ -669,21 +669,21 @@
|
|||||||
noSuggestionsContainer.detach();
|
noSuggestionsContainer.detach();
|
||||||
container.html(html);
|
container.html(html);
|
||||||
|
|
||||||
// Select first value by default:
|
|
||||||
if (options.autoSelectFirst) {
|
|
||||||
that.selectedIndex = 0;
|
|
||||||
container.children().first().addClass(classSelected);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($.isFunction(beforeRender)) {
|
if ($.isFunction(beforeRender)) {
|
||||||
beforeRender.call(that.element, container);
|
beforeRender.call(that.element, container);
|
||||||
}
|
}
|
||||||
|
|
||||||
that.fixPosition();
|
that.fixPosition();
|
||||||
|
|
||||||
container.show();
|
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();
|
that.findBestHint();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user