mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
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.
This commit is contained in:
parent
38af07ec4e
commit
36110e07d4
8
ui/jquery.ui.autocomplete.js
vendored
8
ui/jquery.ui.autocomplete.js
vendored
@ -490,12 +490,12 @@ $.widget("ui.menu", {
|
|||||||
this.deactivate();
|
this.deactivate();
|
||||||
if (this.hasScroll()) {
|
if (this.hasScroll()) {
|
||||||
var offset = item.offset().top - this.element.offset().top,
|
var offset = item.offset().top - this.element.offset().top,
|
||||||
scroll = this.element.attr("scrollTop"),
|
scroll = this.element.scrollTop(),
|
||||||
elementHeight = this.element.height();
|
elementHeight = this.element.height();
|
||||||
if (offset < 0) {
|
if (offset < 0) {
|
||||||
this.element.attr("scrollTop", scroll + offset);
|
this.element.scrollTop( scroll + offset);
|
||||||
} else if (offset >= elementHeight) {
|
} 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)
|
this.active = item.eq(0)
|
||||||
@ -601,7 +601,7 @@ $.widget("ui.menu", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
hasScroll: function() {
|
hasScroll: function() {
|
||||||
return this.element.height() < this.element.attr("scrollHeight");
|
return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
|
||||||
},
|
},
|
||||||
|
|
||||||
select: function( event ) {
|
select: function( event ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user