Showing with 15 additions and 3 deletions.
  1. +2 −1 js/jquery.mobile.forms.select.custom.js
  2. +1 −1 js/jquery.mobile.forms.select.js
  3. +8 −1 tests/unit/select/index.html
  4. +4 −0 tests/unit/select/select_core.js
@@ -491,7 +491,8 @@ define( [
$( document ).bind( "selectmenubeforecreate", function( event ){
var selectmenuWidget = $( event.target ).data( "selectmenu" );

if( !selectmenuWidget.options.nativeMenu ){
if( !selectmenuWidget.options.nativeMenu &&
selectmenuWidget.element.parents(":jqmData(role='popup')").length === 0 ){
extendSelect( selectmenuWidget );
}
});
@@ -78,7 +78,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
_create: function() {
this._preExtension();

// Allows for extension of the native select for custom selects and other plugins
// Allows for extension of the native select for custom selects and other plugins
// see select.custom for example extension
// TODO explore plugin registration
this._trigger( "beforeCreate" );
@@ -86,6 +86,14 @@ <h2 id="qunit-userAgent"></h2>
</select>
</div>

<div data-nstest-role="popup" id="popup-containing-select">
<select name="select-choice-inside-popup" id="select-choice-inside-popup" data-nstest-native-menu="false">
<option value="abracadabra">Abracadabra</option>
<option value="simsalabim">Simsalabim</option>
<option value="csiribu-csiriba">Csiribu-Csiriba</option>
</select>
</div>

<div data-nstest-role="fieldcontain" id="select-choice-many-container-1">
<label for="select-choice-many-1" class="select">Your state:</label>
<select name="select-choice-many-1" id="select-choice-many-1" data-nstest-native-menu="false">
@@ -415,7 +423,6 @@ <h2 id="qunit-userAgent"></h2>
</select>
</div>


<div id="enhancetest">
<select name="select-enhancetest" id="select-enhancetest">
<option value="standard">Standard: 7 day</option>
@@ -151,6 +151,10 @@
}
});

test( "a popup containing a non-native select will cause the select to be rendered as native", function() {
ok( $( "#select-choice-inside-popup-menu" ).length === 0, "non-native select inside popup has no generated menu" );
});

asyncTest( "a large select option should not overflow", function(){
// https://github.com/jquery/jquery-mobile/issues/1338
var menu, select;