We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21d96f1 commit 759e47aCopy full SHA for 759e47a
ui/jquery.ui.selectmenu.js
@@ -204,7 +204,14 @@ $.widget( "ui.selectmenu", {
204
this.menu.menu( "focus", event, currentItem );
205
}, 1);
206
207
- if ( !this.options.dropdown ) {
+ if ( !this.options.dropdown ) {
208
+ // center current item
209
+ if ( this.menu.outerHeight() < this.menu.prop( "scrollHeight" ) ) {
210
+ this.menuWrap.css( "left" , -10000 );
211
+ this.menu.scrollTop( this.menu.scrollTop() + currentItem.position().top - this.menu.outerHeight()/2 + currentItem.outerHeight()/2 );
212
+ this.menuWrap.css( "left" , "auto" );
213
+ }
214
+
215
$.extend( this.options.position, {
216
my: "left top",
217
at: "left top",
0 commit comments