Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Selectmenu: fixed positioning with overflow in IE

  • Loading branch information...
commit 759e47a6573595dd75b426126448132b50a86aa9 1 parent 21d96f1
Felix Nagel fnagel authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 ui/jquery.ui.selectmenu.js
9 ui/jquery.ui.selectmenu.js
View
@@ -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",
Please sign in to comment.
Something went wrong with that request. Please try again.