Autocomplete: changed menu activated function to check if the offset is greater than or equal the height. Fixed #5923 - autocomplete: Scrolling with the keyboard sometimes does not show the item (Chrome)

This commit is contained in:
Robson Braga Araujo 2010-08-11 07:23:10 +08:00 committed by Scott González
parent 9a4eecdf85
commit 3af1f6c1ce

View File

@ -429,7 +429,7 @@ $.widget("ui.menu", {
elementHeight = this.element.height(); elementHeight = this.element.height();
if (offset < 0) { if (offset < 0) {
this.element.attr("scrollTop", scroll + offset); this.element.attr("scrollTop", scroll + offset);
} else if (offset > elementHeight) { } else if (offset >= elementHeight) {
this.element.attr("scrollTop", scroll + offset - elementHeight + item.height()); this.element.attr("scrollTop", scroll + offset - elementHeight + item.height());
} }
} }