-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathselectmenu.xml
492 lines (427 loc) · 29.2 KB
/
selectmenu.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
<entry name="selectmenu" namespace="fn" type="widget" widgetnamespace="mobile" event-prefix="select" init-selector="select:not( :jqmData(role='slider')):not( :jqmData(role='flipswitch') )">
<title>Selectmenu Widget</title>
<desc>Creates a select menu widget</desc>
<longdesc>
<p>The select menu is based on a native select element, which is hidden from view and replaced with a custom-styled select button that matches the look and feel of the jQuery Mobile framework. The select menu is ARIA-enabled and keyboard accessible on the desktop as well.</p>
<p>By default, the framework leverages the native OS options menu to use with the custom button. When the button is clicked, the native OS menu will open. When a value is selected and the menu closes, the custom button's text is updated to match the selected value. Please note that the framework also offers the possibility of having custom (non-native) select menus.</p>
<p>To add a select menu to your page, start with a standard <code>select</code> element populated with a set of <code>option</code> elements. Set the <code>for</code> attribute of the <code>label</code> to match the <code>id</code> of the <code>select</code> so they are semantically associated. It's possible to accessibly hide the label if it's not desired in the page layout, but we require that it is present in the markup for semantic and accessibility reasons.</p>
<p>The framework will find all <code>select</code> elements and automatically enhance them into select menus, no need to apply a <code>data-role</code> attribute. To prevent the automatic enhancement of a select, add <code>data-role="none"</code> attribute to the <code>select</code>.</p>
<xi:include href="../includes/widget-theming.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<ul>
<li>
<code>ui-selectmenu</code>: The outermost container for selectmenu.
<ul>
<li>
<code>ui-selectmenu-button</code>: Custom styled button for the selectmenu
<ul>
<li>
<code>ui-selectmenu-button-icon</code>: Selectmenu button icon
</li>
<li>
<code>ui-selectmenu-button-text</code>: Selectmenu button text
</li>
</ul>
</li>
</ul>
<code>ui-selectmenu-custom</code>: The outermost container for custom selectmenu.
<ul>
<li>
<code>ui-selectmenu-custom-list</code>: List element for custom selectmenu
<ul>
<li>
<code>ui-selectmenu-custom-header-close-button</code>: Close button for custom selectmenu
<ul>
<li>
<code>ui-selectmenu-custom-header-close-button-icom</code>: Close button icon for custom selectmenu
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<pre><code><![CDATA[
<label for="select-choice-0" class="select">Shipping method:</label>
<select name="select-choice-0" id="select-choice-0">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
]]></code></pre>
<p>This will produce a basic select menu. The default styles set the width of the input to 100% of the parent container and stacks the label on a separate line.
<iframe src="/resources/select/example1.html" style="width:100%;height:190px;border:0px"></iframe></p>
<h2 id="mini-version">Mini version</h2>
<p>For a more compact version that is useful in toolbars and tight spaces, add the <code>data-mini="true"</code> attribute to the element to create a mini version. </p>
<pre><code><![CDATA[
<label for="select-choice-min" class="select">Shipping method:</label>
<select name="select-choice-min" id="select-choice-min" data-mini="true">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
]]></code></pre>
<p>This will produce a select that a not as tall as the standard version and has a smaller text size.
<iframe src="/resources/select/example2.html" style="width:100%;height:190px;border:0px"></iframe></p>
<h2 id="field-containers">Field containers</h2>
<p>Optionally wrap the selects in a container with class <code>ui-field-contain</code> to help visually group it in a longer form.</p>
<div class="warning">
<p><strong>Note:</strong> The <code>data-</code> attribute <code>data-role="fieldcontain"</code> is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0. Add class <code>ui-field-contain</code> instead.</p>
</div>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="select-choice-1" class="select">Shipping method:</label>
<select name="select-choice-1" id="select-choice-1">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
]]></code></pre>
<p>The select input is now displayed like this:
<iframe src="/resources/select/example3.html" style="width:100%;height:190px;border:0px"></iframe></p>
<p>An example of a select with a long list of options:
<iframe src="/resources/select/example4.html" style="width:100%;height:590px;border:0px"></iframe></p>
<h2 id="optgroups">Optgroups</h2>
<p>The following example organizes the options into <code>optgroup</code> elements. Support for this feature in mobile selects is a bit spotty, but is improving.</p>
<pre><code><![CDATA[
<div class="ui-field-contain">
<label for="select-choice-nc" class="select">Preferred delivery:</label>
<select name="select-choice-8" id="select-choice-nc">
<optgroup label="FedEx">
<option value="firstOvernight">First Overnight</option>
<option value="expressSaver">Express Saver</option>
<option value="ground">Ground</option>
</optgroup>
<optgroup label="UPS">
<option value="firstOvernight">First Overnight</option>
<option value="expressSaver">Express Saver</option>
<option value="ground">Ground</option>
</optgroup>
<optgroup label="US Mail">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day (disabled)</option>
<option value="overnight">Overnight</option>
</optgroup>
</select>
</div>
]]></code></pre>
<iframe src="/resources/select/example5.html" style="width:100%;height:390px;border:0px"></iframe>
<h2 id="vertically-grouped-select-inputs">Vertically grouped select inputs</h2>
<p>To create a grouped set of select inputs, first add <code>select</code> and a corresponding <code>label</code>. Set the <code>for</code> attribute of the <code>label</code> to match the <code>id</code> of the <code>select</code> so they are semantically associated.</p>
<p>Because the <code>label</code> element will be associated with each individual select input and will be hidden for styling purposes, we recommend wrapping the selects in a <code>fieldset</code> element that has a <code>legend</code> which acts as the combined label for the grouped inputs.</p>
<p>Lastly, one needs to wrap the <code>fieldset</code> in a <code>div</code> with <code>data-role="controlgroup"</code> attribute, so it can be styled as a group.</p>
<pre><code><![CDATA[
<div class="ui-field-contain">
<fieldset data-role="controlgroup">
<legend>Date of Birth:</legend>
<label for="select-choice-month">Month</label>
<select name="select-choice-month" id="select-choice-month">
<option>Month</option>
<option value="jan">January</option>
<!-- etc. -->
</select>
<label for="select-choice-day">Day</label>
<select name="select-choice-day" id="select-choice-day">
<option>Day</option>
<option value="1">1</option>
<!-- etc. -->
</select>
<label for="select-choice-year">Year</label>
<select name="select-choice-year" id="select-choice-year">
<option>Year</option>
<option value="2011">2011</option>
<!-- etc. -->
</select>
</fieldset>
</div>
]]></code></pre>
<iframe src="/resources/select/example6.html" style="width:100%;height:390px;border:0px"></iframe>
<h2 id="horizontally-grouped-select-inputs">Horizontally grouped select inputs</h2>
<p>Select inputs can also be used for grouped sets with more than one related selections. To make a horizontal button set, add the <code>data-type="horizontal"</code> to the fieldset. Note that the buttons which trigger the select will resize depending on the currently selected option’s value.</p>
<pre><code><![CDATA[
<fieldset data-role="controlgroup" data-type="horizontal">
]]></code></pre>
<iframe src="/resources/select/example7.html" style="width:100%;height:190px;border:0px"></iframe>
<h2 id="theming-selects">Theming selects</h2>
<p>You can specify any jQuery Mobile button <code>data-</code> attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:
<iframe src="/resources/select/example8.html" style="width:100%;height:190px;border:0px"></iframe>
</p>
<h2 id="custom-select-menus">Custom select menus</h2>
<p>The framework is capable of building a custom menu based on the <code>select</code> element's list of options. We recommend using a custom menu when multiple selections are required, or when the menu itself must be styled with CSS.</p>
<p>You can optionally use custom-styled select menus instead of the native OS menu. The custom menu supports disabled options and multiple selection (whereas native mobile OS support for both is inconsistent), adds an elegant way to handle placeholder values, and restores missing functionality on certain platforms such as <code>optgroup</code> support on Android (all explained below). In addition, the framework applies the custom button's theme to the menu to better match the look and feel and provide visual consistency across platforms. Lastly, custom menus often look better on desktop browsers because native desktop menus are smaller than their mobile counterparts and tend to look disproportionate.</p>
<p>Keep in mind that there is overhead involved in parsing the native select to build a custom menu. If there are a lot of selects on a page, or a select has a long list of options, this can impact the performance of the page, so we recommend using custom menus sparingly. </p>
<p>To use custom menus on a specific <code>select</code>, just add the <code>data-native-menu="false"</code> attribute. Alternately, this can also programmatically set the select menu's <code>nativeMenu</code> configuration option to <code>false</code> in a callback bound to the <code>mobileinit</code> event to achieve the same effect. This will globally make all selects use the custom menu by default. The following must be included in the page after jQuery is loaded but before jQuery Mobile is loaded.</p>
<pre><code><![CDATA[
$(document).on( "mobileinit", function() {
$.mobile.selectmenu.prototype.options.nativeMenu = false;
});
]]></code></pre>
<p>When the <code>select</code> has a small number of options that will fit on the device's screen, the menu will appear as a small overlay with a pop transition:
<iframe src="/resources/select/example9.html" style="width:100%;height:270px;border:0px"></iframe></p>
<p>When it has too many options to show on the device's screen, the framework will automatically create a new dialog-style "page" populated with a standard <a href="listview">listview</a> for the options. This allows us to use the native scrolling included on the device for moving through a long list. The text inside the <code>label</code> is used as the title for this page. Be aware of the page and pagecontainer events that will be fired for this generated page.
<iframe src="/resources/select/example10.html" style="width:100%;height:590px;border:0px"></iframe></p>
<p class="warning"><strong>Note:</strong> The behavior whereby the custom select menu creates a new page when the list of options is long is deprecated as of jQuery Mobile 1.4.0. Starting with 1.5.0, the custom select menu will fall back to utilizing the select menu's native behavior when the list of options is too long.</p>
<h2 id="disabled-options">Disabled options</h2>
<p>jQuery Mobile will automatically disable and style option tags with the <code>disabled</code> attribute. In the demo below, the second option "Rush: 3 days" has been set to disabled.
<iframe src="/resources/select/example11.html" style="width:100%;height:270px;border:0px"></iframe></p>
<h2 id="placeholder-options">Placeholder options</h2>
<p>It's common for developers to include a "null" option in their select element to force a user to choose an option. If a placeholder option is present in your markup, jQuery Mobile will hide them in the overlay menu, showing only valid choices to the user, and display the placeholder text inside the menu as a header. A placeholder option is added when the framework finds:</p>
<ul>
<li>An option with no value attribute</li>
<li>An option with an empty value attribute (<code>value=""</code>). <p class="warning"><strong>Note:</strong> Indicating that an option should be used as a placeholder by providing the <code>value</code> attribute and setting it to "" is deprecated as of jQuery Mobile 1.4.0 and will be removed in 1.5.0.</p></li>
<li>An option with no text node</li>
<li>An option with a <code>data-placeholder="true"</code> attribute. (This allows you to use an option that has a value and a textnode as a placeholder option).</li>
</ul>
<p>You can disable this feature through the selectmenu plugin's <code>hidePlaceholderMenuItems</code> option, like this:</p>
<pre><code><![CDATA[
$.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false;
]]></code></pre>
<p>Examples of various placeholder options:
<iframe src="/resources/select/example12.html" style="width:100%;height:390px;border:0px"></iframe></p>
<h2 id="multiple-selects">Multiple selects</h2>
<p>If the <code>multiple</code> attribute is present in your markup, jQuery Mobile will enhance the element with a few extra considerations:</p>
<ul>
<li>A header element will be created inside the menu and display the placeholder text and a close button.</li>
<li>Clicking on an item inside the overlay menu will not close the widget.</li>
<li>A ghosted, unchecked icon will appear adjacent to each unselected item. When the item is selected the icon will change to a checkbox. Neither icon will appear inside a single select box.</li>
<li>Once 2+ items are selected, a counter element with the total number of selected items will appear inside the button.</li>
<li>The text of each selected item will appear inside the button as a list. If the button is not wide enough to display the entire list, it is truncated with an ellipses.</li>
<li>If no items are selected, the button's text will default to the placeholder text.</li>
<li>If no placeholder element exists, the default button text will be blank and the header will appear with just a close button. Because this isn't a friendly user experience, we recommended that you always specify a placeholder element when using multiple select boxes.</li>
<li><span class="warning">Currently jQuery Mobile only supports the <code>multiple</code> attribute on a <code>select</code> with <code>nativeMenu</code> set to <code>false</code>.</span></li>
</ul>
<iframe src="/resources/select/example13.html" style="width:100%;height:310px;border:0px"></iframe>
<p>When a select is large enough to where the menu will open in a new page, the placeholder text is displayed in the button when no items are selected, and the <code>label</code> text is displayed in the menu's header. This differs from smaller overlay menus where the placeholder text is displayed in both the button and the header, and from full-page single selects where the placeholder text is not used at all.
<iframe src="/resources/select/example14.html" style="width:100%;height:590px;border:0px"></iframe></p>
<h2 id="optgroup-support">Optgroup support</h2>
<p>If a select menu contains <code>optgroup</code> elements, jQuery Mobile will create a divider & group items based on the <code>label</code> attribute's text:
<iframe src="/resources/select/example15.html" style="width:100%;height:500px;border:0px"></iframe></p>
<h2 id="theming-selects">Theming selects</h2>
<p>You can specify any jQuery Mobile button <code>data-</code> attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:
<iframe src="/resources/select/example16.html" style="width:100%;height:310px;border:0px"></iframe></p>
<p>The <code>data-overlay-theme</code> attribute can be added to a select element to set the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. By default, the content block colors for swatch "a" will be used for the overlays.
<p>Note: Custom selects use the popup widget for the menu. Because the popup container is elsewhere on the page it can't inherit the theme swatch from the parent of the select, and inherits from the page instead.</p>
<iframe src="/resources/select/example17.html" style="width:100%;height:290px;border:0px"></iframe></p>
<p><iframe src="/resources/select/example18.html" style="width:100%;height:590px;border:0px"></iframe></p>
<h2 id="calling-the-select-menu-plugin">Calling the select menu plugin</h2>
<p>The select menu plugin will auto initialize on any page that contains a select menu, without any need for a <code>data-role</code> attribute in the markup. However, you can directly call the select menu plugin on any selector, just like any normal jQuery plugin:</p>
<pre><code><![CDATA[
$( "select" ).selectmenu();
]]></code></pre>
<h2 id="id-generation">ID generation</h2>
<p>The <placeholder name="name"/> widget adds an ID to the elements it generates. If it doesn't itself have an ID, it will use a prefix consisting of <code>select-</code> and a unique number for the elements. If it does have an ID, it will use its ID as the prefix. The ID for the various elements generated by the <placeholder name="name"/> widget is then constructed as follows:</p>
<dl>
<dt>button</dt>
<dd>
<code><strong><![CDATA[<prefix>]]></strong><![CDATA[-button]]></code>
</dd>
<dt>popup</dt>
<dd>
<code><strong><![CDATA[<prefix>]]></strong><![CDATA[-listbox]]></code>
<p>This id is only assigned to an element when the <placeholder name="name"/> widget is constructed with the option <code>nativeMenu</code> set to <code>false</code>.</p>
<p>Since the menu is implemented as a popup it will assign IDs to its generated elements. See the popup widget's <a href="/popup/#id-generation">id generation</a> for details.</p>
</dd>
<dt>listview</dt>
<dd>
<code><strong><![CDATA[<prefix>]]></strong><![CDATA[-menu]]></code>
<p>This id is only assigned to an element when the <placeholder name="name"/> widget is constructed with the option <code>nativeMenu</code> set to <code>false</code>.</p>
</dd>
</dl>
<p>For example, creating a non-native <placeholder name="name"/> with</p>
<pre><code><![CDATA[
<select id="choose-city" data-native-menu="false">
<option>Caracas</option>
<option>Warszawa</option>
<option>Yekaterinburg</option>
<option>Pretoria</option>
</select>
]]></code></pre>
<p>will result in the following markup:</p>
<pre><code><![CDATA[
<div class="ui-select">
<a id="choose-city-button" href="#" role="button" aria-haspopup="true" class="ui-btn ui-icon-carat-d ui-btn-icon-right ui-corner-all ui-shadow" data-rel="popup">
<span>Caracas</span>
</a>
<select id="choose-city" data-native-menu="false" tabindex="-1">
<option>Caracas</option>
<option>Warszawa</option>
<option>Yekaterinburg</option>
<option>Pretoria</option>
</select>
<div id="choose-city-listbox-placeholder" style="display: hidden;"></div>
</div>
<div id="choose-city-listbox-screen" class="ui-popup-screen ui-screen-hidden ui-overlay-inherit"></div>
<div id="choose-city-listbox-popup" class="ui-popup-container ui-popup-hidden ui-popup-truncate">
<div id="choose-city-listbox" class="ui-selectmenu ui-popup ui-body-inherit ui-overlay-shadow ui-corner-all">
<div class="ui-header" ui-bar-inherit ui-screen-hidden">
<h1 class="ui-title"></h1>
</div>
<ul id="choose-city-menu" class="ui-selectmenu-list ui-listview" role="listbox" aria-labelledby="choose-city-button">
<li data-option-index="0" data-icon="false" class="ui-first-child" role="option" aria-selected="true">
<a href="#" tabindex="-1" class="ui-btn ui-btn-active">Caracas</a>
</li>
<li data-option-index="0" data-icon="false" role="option" aria-selected="false">
<a href="#" tabindex="-1" class="ui-btn ui-btn-active">Warszawa</a>
</li>
<li data-option-index="0" data-icon="false" role="option" aria-selected="false">
<a href="#" tabindex="-1" class="ui-btn ui-btn-active">Yekaterinburg</a>
</li>
<li data-option-index="0" data-icon="false" class="ui-last-child" role="option" aria-selected="false">
<a href="#" tabindex="-1" class="ui-btn ui-btn-active">Pretoria</a>
</li>
</ul>
</div>
</div>
]]></code></pre>
</longdesc>
<added>1.0</added>
<options>
<option name="classes" type="Object">
<default>{
"ui-selectmenu-button": "ui-corner-all ui-shadow",
"ui-selectmenu-custom-header-close-button": "ui-corner-all"
}</default>
<xi:include href="../includes/classes-option-desc.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/classes-option-example.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</option>
<option name="closeText" default='"Close"' example-value='"Fermer"'>
<desc>
<p>Customizes the text of the close button which is helpful for translating this into different languages. The close button is displayed as an icon-only button by default so the text isn't visible on-screen, but is read by screen readers so this is an important accessibility feature.</p>
<p>This option is also exposed as a data attribute: <code>data-close-text="Fermer"</code>.</p>
</desc>
</option>
<option name="corners" default="true" example-value="false">
<desc>Applies the theme button border-radius to the select button if set to true.
<p>This option is also exposed as a data attribute: <code>data-corners="false"</code>.</p>
</desc>
<type name="Boolean" />
</option>
<xi:include href="../includes/widget-option-defaults.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-option-disabled.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<option name="dividerTheme" default="null, inherited from parent" example-value='"b"'>
<desc>
Sets the color scheme (swatch) for the listview dividers that represent the <code>optgroup</code> headers. It accepts a single letter from a-z that maps to the swatches included in your theme.
<p>Possible values: swatch letter (a-z).</p>
<p>This option is also exposed as a data attribute: <code>data-divider-theme="b"</code>.</p>
</desc>
<type name="String" />
</option>
<option name="hidePlaceholderMenuItems" type="Boolean" default="true" example-value="false">
<desc>
Sets whether placeholder menu items are hidden. When true, the menu item used as the placeholder for the select menu widget will not appear in the list of choices.
<p>This option is also exposed as a data attribute: <code>data-hide-placeholder-menu-items="false"</code>.</p>
</desc>
</option>
<option name="icon" default='"carat-d"' example-value='"star"'>
<desc>Replaces the default icon "carat-d" with an icon from the icon set. Setting this attribute to "false" suppresses the icon.
<p>To suppress the icon, a boolean expression must be used:</p>
<p>This option is also exposed as a data attribute: <code>data-icon="star"</code>.</p>
</desc>
<type name="String" />
</option>
<option name="iconpos" default='"right"' example-value='"left"'>
<desc>Position of the icon in the select button. Possible values: left, right, top, bottom, notext. The notext value will display the select as an icon-only button with no text feedback.
<p>This option is also exposed as a data attribute: <code>data-iconpos="left"</code>.</p>
</desc>
<type name="String" />
</option>
<option name="iconshadow" default="true" example-value="false" deprecated="1.4.0">
<desc>
<strong>This option is deprecated in 1.4.0 and will be removed in 1.5.0.</strong>
<p>Applies the theme shadow to the select button's icon if set to true.</p>
<p>This option is also exposed as a data attribute: <code>data-iconshadow="false"</code>.</p>
</desc>
<type name="Boolean" />
</option>
<xi:include href="../includes/widget-option-initSelector.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<option name="inline" default="null (false)" example-value="true">
<desc>If set to true, this will make the select button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the select button is full width, regardless of the feedback content. Possible values: true, false.
<p>This option is also exposed as a data attribute: <code>data-inline="true"</code>.</p>
</desc>
<type name="Boolean" />
</option>
<xi:include href="../includes/widget-option-mini.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<option name="nativeMenu" default="true" example-value="false">
<desc>When set to true, clicking the custom-styled select menu will open the native select menu which is best for performance. If set to false, the custom select menu style will be used instead of the native menu.
<p>This option is also exposed as a data attribute: <code>data-native-menu="false"</code>.</p>
</desc>
<type name="Boolean" />
</option>
<option name="preventFocusZoom" default="true on iOS platforms" example-value="false">
<desc>This option disables page zoom temporarily when a custom select is focused, which prevents iOS devices from zooming the page into the select. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts.
<p>This option is also exposed as a data attribute: <code>data-prevent-focus-zoom="true"</code>.</p>
</desc>
<type name="Boolean" />
</option>
<option name="shadow" default="true" example-value="false">
<desc>Applies the drop shadow style to the select button if set to true.
<p>This option is also exposed as a data attribute: <code>data-shadow="false"</code>.</p>
</desc>
<type name="Boolean" />
</option>
<option name="overlayTheme" default='"null, inherited from parent"' example-value='"a"'>
<desc>Sets the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, the content block colors for the overlay will be inherited from the parent of the select.
<p>This option is also exposed as a data attribute: <code>data-overlay-theme="a"</code>.</p>
</desc>
<type name="String" />
</option>
<xi:include href="../includes/widget-option-theme.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</options>
<events>
<xi:include href="../includes/widget-event-create.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
</events>
<methods>
<method name="close">
<desc>close an open select menu.
</desc>
</method>
<xi:include href="../includes/widget-method-destroy.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-disable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<xi:include href="../includes/widget-method-enable.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="open">
<desc>open a closed select menu (custom menus only).
</desc>
</method>
<xi:include href="../includes/widget-method-option.xml" xmlns:xi="http://www.w3.org/2003/XInclude"/>
<method name="refresh">
<desc>
</desc>
<signature>
<desc>update the custom select.<p>This is used to update the custom select to reflect the native select element's value. If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu.</p></desc>
</signature>
<signature example-params="true">
<desc>update the custom select.<p>This is used to update the custom select to reflect the native select element's value. If the number of options in the select are different than the number of items in the custom menu, it'll rebuild the custom menu. If you pass a true argument you can force the rebuild to happen.</p></desc>
<argument name="option" type="Boolean">
<desc>to force a rebuild</desc>
</argument>
</signature>
</method>
</methods>
<example>
<desc>A basic example of a simple native select</desc>
<html><![CDATA[
<div data-role="page" id="page1">
<div data-role="header">
<h1>jQuery Mobile Example</h1>
</div>
<div role="main" class="ui-content">
<label for="select-choice-0" class="select">Shipping method:</label>
<select name="select-choice-0" id="select-choice-0">
<option value="standard">Standard: 7 day</option>
<option value="rush">Rush: 3 days</option>
<option value="express">Express: next day</option>
<option value="overnight">Overnight</option>
</select>
</div>
</div>
]]></html>
</example>
<category slug="widgets"/>
</entry>