From af4c35df9d1cf4c15d57b3789711026360785831 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 4 Mar 2015 14:27:10 -0500 Subject: Selectmenu: Support `width: false` and default to 14em `width: null` still matches the width of the original element. `width: false` prevents an inline style from being set for the width. This makes it easy to set the width via a stylesheet and allows the use of any unit for setting the width, such as the new default of `14em`. Fixes #11198 Closes gh-1467 --- tests/unit/selectmenu/selectmenu_common.js | 2 +- tests/unit/selectmenu/selectmenu_options.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/unit/selectmenu/selectmenu_common.js b/tests/unit/selectmenu/selectmenu_common.js index 10073fe97..bc245f962 100644 --- a/tests/unit/selectmenu/selectmenu_common.js +++ b/tests/unit/selectmenu/selectmenu_common.js @@ -10,7 +10,7 @@ TestHelpers.commonWidgetTests( "selectmenu", { at: "left bottom", collision: "none" }, - width: null, + width: false, // callbacks change: null, diff --git a/tests/unit/selectmenu/selectmenu_options.js b/tests/unit/selectmenu/selectmenu_options.js index 954d572b5..08555a1af 100644 --- a/tests/unit/selectmenu/selectmenu_options.js +++ b/tests/unit/selectmenu/selectmenu_options.js @@ -85,7 +85,7 @@ test( "CSS styles", function() { }); test( "width", function() { - expect( 5 ); + expect( 6 ); var button, element = $( "#speed" ); @@ -93,6 +93,9 @@ test( "width", function() { element.selectmenu(); button = element.selectmenu( "widget" ); + equal( button[ 0 ].style.width, "", "no inline style" ); + + element.selectmenu( "option", "width", null ); equal( button.outerWidth(), element.outerWidth(), "button width auto" ); element.outerWidth( 100 ); @@ -107,7 +110,7 @@ test( "width", function() { element .append( $( "