Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ui/selectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ return $.widget( "ui.selectmenu", {
position: {
my: "left top",
at: "left bottom",
collision: "none"
collision: "flip"
},
width: null,

Expand Down Expand Up @@ -617,6 +617,15 @@ return $.widget( "ui.selectmenu", {
// so we add 1px to avoid the wrapping
this.menu.width( "" ).outerWidth() + 1
) );

// Reset the height of the menu and calculate the max height
this.menu.css( "height", "auto" );
var menuHeight = this.menu.height();
var maxMenuHeight = Math.round( $( window ).height() / 3 );

if ( maxMenuHeight < menuHeight ) {
this.menu.height( maxMenuHeight );
}
},

_getCreateOptions: function() {
Expand Down