Skip to content

Commit

Permalink
fixed: its now possible to have a disabled and selected option on ini…
Browse files Browse the repository at this point in the history
…t, see jquery#234
  • Loading branch information
fnagel committed Jul 20, 2012
1 parent c67774f commit 690fcb3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion demos/selectmenu/disable_enable.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@

var speedC = $('select#speedC').selectmenu();

var speedD = $('select#speedD').selectmenu();
var speedD = $('select#speedD').selectmenu();

var speedD_first = $('select#speedD_first').selectmenu();

var speedD2 = $('select#speedD2').selectmenu();
$("#optgroupSwitch").toggle(
Expand Down Expand Up @@ -169,6 +171,16 @@ <h3>HTML</h3>
</select>
</fieldset>

<fieldset>
<label for="speedD_first">Disabled and selected first option by HTML</label>
<select id="speedD_first">
<option disabled="disabled" selected="selected">Choose one...</option>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
<select>
</fieldset>

<fieldset>
<label for="speedD3">Disabled optgroup by HTML</label>
<select name="speedD3" id="speedD3">
Expand Down
2 changes: 1 addition & 1 deletion ui/jquery.ui.selectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ $.widget("ui.selectmenu", {
}

// update value
this.index( this._selectedIndex() );
this._refreshValue();

// set selected item so movefocus has intial state
this._selectedOptionLi().addClass(this.widgetBaseClass + '-item-focus');
Expand Down

0 comments on commit 690fcb3

Please sign in to comment.