aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.selectmenu.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-01-22 15:20:35 +0100
committerFelix Nagel <info@felixnagel.com>2012-01-22 15:20:35 +0100
commit759e47a6573595dd75b426126448132b50a86aa9 (patch)
tree9425a5490a0ae3be0e861f7f322f946232d4a7cc /ui/jquery.ui.selectmenu.js
parent21d96f12f802f13c4c159ab9b2e0a6df3771be42 (diff)
downloadjquery-ui-759e47a6573595dd75b426126448132b50a86aa9.tar.gz
jquery-ui-759e47a6573595dd75b426126448132b50a86aa9.zip
Selectmenu: fixed positioning with overflow in IE
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r--ui/jquery.ui.selectmenu.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index af34b4e19..94bdd19a3 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -204,7 +204,14 @@ $.widget( "ui.selectmenu", {
this.menu.menu( "focus", event, currentItem );
}, 1);
- if ( !this.options.dropdown ) {
+ 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",