Selectmenu: fixed positioning with overflow in IE

This commit is contained in:
Felix Nagel 2012-01-22 15:20:35 +01:00
parent 21d96f12f8
commit 759e47a657

View File

@ -205,6 +205,13 @@ $.widget( "ui.selectmenu", {
}, 1);
if ( !this.options.dropdown ) {
// center current item
if ( this.menu.outerHeight() < this.menu.prop( "scrollHeight" ) ) {
this.menuWrap.css( "left" , -10000 );
this.menu.scrollTop( this.menu.scrollTop() + currentItem.position().top - this.menu.outerHeight()/2 + currentItem.outerHeight()/2 );
this.menuWrap.css( "left" , "auto" );
}
$.extend( this.options.position, {
my: "left top",
at: "left top",