Skip to content

Commit 9fbadc1

Browse files
committed
Use height of items to compute heightDelta
1 parent d71867a commit 9fbadc1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/jquery.autocomplete.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,16 +851,17 @@
851851

852852
adjustScroll: function (index) {
853853
var that = this,
854-
activeItem = that.activate(index),
855-
offsetTop,
856-
upperBound,
857-
lowerBound,
858-
heightDelta = 25;
854+
activeItem = that.activate(index)
859855

860856
if (!activeItem) {
861857
return;
862858
}
863859

860+
var offsetTop,
861+
upperBound,
862+
lowerBound,
863+
heightDelta = $(activeItem).outerHeight();
864+
864865
offsetTop = activeItem.offsetTop;
865866
upperBound = $(that.suggestionsContainer).scrollTop();
866867
lowerBound = upperBound + that.options.maxHeight - heightDelta;

0 commit comments

Comments
 (0)