Skip to content

Commit f09ac7c

Browse files
committed
fix max height of the selectmenu to be one third of the window height
1 parent 7137c90 commit f09ac7c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

ui/selectmenu.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ return $.widget( "ui.selectmenu", {
4343
position: {
4444
my: "left top",
4545
at: "left bottom",
46-
collision: "none"
46+
collision: "flip"
4747
},
4848
width: null,
4949

@@ -617,6 +617,15 @@ return $.widget( "ui.selectmenu", {
617617
// so we add 1px to avoid the wrapping
618618
this.menu.width( "" ).outerWidth() + 1
619619
) );
620+
621+
// Reset the height of the menu and calculate the max height
622+
this.menu.css( "height", "auto" );
623+
var menuHeight = this.menu.height();
624+
var maxMenuHeight = Math.round( $( window ).height() / 3 );
625+
626+
if ( maxMenuHeight < menuHeight ) {
627+
this.menu.height( maxMenuHeight );
628+
}
620629
},
621630

622631
_getCreateOptions: function() {

0 commit comments

Comments
 (0)