summaryrefslogtreecommitdiffstats
path: root/awesomplete.js
diff options
context:
space:
mode:
Diffstat (limited to 'awesomplete.js')
-rw-r--r--awesomplete.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/awesomplete.js b/awesomplete.js
index 4a0e7e8..f8866f7 100644
--- a/awesomplete.js
+++ b/awesomplete.js
@@ -197,6 +197,9 @@ _.prototype = {
lis[i].setAttribute("aria-selected", "true");
this.status.textContent = lis[i].textContent;
+ // scroll to highlighted element in case parent's height is fixed
+ this.ul.scrollTop = lis[i].offsetTop - this.ul.clientHeight + lis[i].clientHeight;
+
$.fire(this.input, "awesomplete-highlight", {
text: this.suggestions[this.index]
});