Skip to content

Commit 36110e0

Browse files
committed
Autocomplete: Use appropriate methods for getting scroll values for .prop()/.attr() compat. Fixes #7354 - Autocomplete: Scrollable results don't visually update with jQuery 1.6.
1 parent 38af07e commit 36110e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ $.widget("ui.menu", {
490490
this.deactivate();
491491
if (this.hasScroll()) {
492492
var offset = item.offset().top - this.element.offset().top,
493-
scroll = this.element.attr("scrollTop"),
493+
scroll = this.element.scrollTop(),
494494
elementHeight = this.element.height();
495495
if (offset < 0) {
496-
this.element.attr("scrollTop", scroll + offset);
496+
this.element.scrollTop( scroll + offset);
497497
} else if (offset >= elementHeight) {
498-
this.element.attr("scrollTop", scroll + offset - elementHeight + item.height());
498+
this.element.scrollTop( scroll + offset - elementHeight + item.height());
499499
}
500500
}
501501
this.active = item.eq(0)
@@ -601,7 +601,7 @@ $.widget("ui.menu", {
601601
},
602602

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

607607
select: function( event ) {

0 commit comments

Comments
 (0)