Skip to content

Commit 7011574

Browse files
committed
Leave height as auto for Android 2 where internal divs don't scroll
1 parent 3268978 commit 7011574

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ui/jquery.ui.selectmenu.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,15 @@ $.widget("ui.selectmenu", {
414414
this.list.width( o.menuWidth ? o.menuWidth : o.width - o.handleWidth );
415415
}
416416

417-
// reset height to auto
418-
this.list.css( 'height', 'auto' );
419-
var listH = this.listWrap.height();
420-
var winH = $( window ).height();
421-
// calculate default max height
422-
var maxH = o.maxHeight ? Math.min( o.maxHeight, winH ) : winH / 3;
423-
if ( listH > maxH ) this.list.height( maxH );
417+
// Android 2 (Gingerbread) doesn't support internal scrollable divs.
418+
// Don't limit the menu height for that browser.
419+
if ( !navigator.userAgent.match( /Android 2/ ) ) {
420+
var listH = this.listWrap.height();
421+
var winH = $( window ).height();
422+
// calculate default max height
423+
var maxH = o.maxHeight ? Math.min( o.maxHeight, winH ) : winH / 3;
424+
if ( listH > maxH ) this.list.height( maxH );
425+
}
424426

425427
// save reference to actionable li's (not group label li's)
426428
this._optionLis = this.list.find( 'li:not(.ui-selectmenu-group)' );

0 commit comments

Comments
 (0)