Skip to content

Commit

Permalink
Autocomplete: Use appropriate methods for getting scroll values for .…
Browse files Browse the repository at this point in the history
…prop()/.attr() compat. Fixes #7354 - Autocomplete: Scrollable results don't visually update with jQuery 1.6.
  • Loading branch information
scottgonzalez committed May 11, 2011
1 parent 38af07e commit 36110e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/jquery.ui.autocomplete.js
Expand Up @@ -490,12 +490,12 @@ $.widget("ui.menu", {
this.deactivate();
if (this.hasScroll()) {
var offset = item.offset().top - this.element.offset().top,
scroll = this.element.attr("scrollTop"),
scroll = this.element.scrollTop(),
elementHeight = this.element.height();
if (offset < 0) {
this.element.attr("scrollTop", scroll + offset);
this.element.scrollTop( scroll + offset);
} else if (offset >= elementHeight) {
this.element.attr("scrollTop", scroll + offset - elementHeight + item.height());
this.element.scrollTop( scroll + offset - elementHeight + item.height());
}
}
this.active = item.eq(0)
Expand Down Expand Up @@ -601,7 +601,7 @@ $.widget("ui.menu", {
},

hasScroll: function() {
return this.element.height() < this.element.attr("scrollHeight");
return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
},

select: function( event ) {
Expand Down

0 comments on commit 36110e0

Please sign in to comment.