2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-09 14:50:57 +00:00

Use height of items to compute heightDelta

This commit is contained in:
Jens Balvig 2014-09-25 09:16:42 +02:00
parent d71867a090
commit 9fbadc1451

View File

@ -851,16 +851,17 @@
adjustScroll: function (index) {
var that = this,
activeItem = that.activate(index),
offsetTop,
upperBound,
lowerBound,
heightDelta = 25;
activeItem = that.activate(index)
if (!activeItem) {
return;
}
var offsetTop,
upperBound,
lowerBound,
heightDelta = $(activeItem).outerHeight();
offsetTop = activeItem.offsetTop;
upperBound = $(that.suggestionsContainer).scrollTop();
lowerBound = upperBound + that.options.maxHeight - heightDelta;