Skip to content

Commit

Permalink
chrome was not honoring pre-selected tags. fixes #46
Browse files Browse the repository at this point in the history
  • Loading branch information
ehynds committed Dec 17, 2010
1 parent 3fd9286 commit de5dc55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion demos/single.htm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2>Single Select</h2>

<form>
<p>
<select name="demo" multiple="multiple" size="5">
<select name="demo">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
Expand Down
8 changes: 4 additions & 4 deletions src/jquery.multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ $.widget("ech.multiselect", {
$parent = $this.parent(),
isDisabled = $this.is(':disabled'),
labelClasses = ['ui-corner-all'],
label, input, checkbox, li;
label, input, li;

// is this an optgroup?
if( $parent.is('optgroup') ){
Expand Down Expand Up @@ -158,9 +158,9 @@ $.widget("ech.multiselect", {
.addClass(labelClasses.join(' '))
.appendTo( li );

// attr's are inlined to support form reset
checkbox = $('<input type="'+(o.multiple ? 'checkbox' : 'radio')+'" '+($this.is(':selected') ? 'checked="checked"' : '')+ '" name="multiselect_'+id + '" />')
.attr({ id:inputID, title:title, disabled:isDisabled, 'aria-disabled':isDisabled })
// attr's are inlined to support form reset. double checked attr is to support chrome bug - see #46
$('<input type="'+(o.multiple ? 'checkbox' : 'radio')+'" '+(this.selected ? 'checked="checked"' : '')+ ' name="multiselect_'+id + '" />')
.attr({ id:inputID, checked:this.selected, title:title, disabled:isDisabled, 'aria-disabled':isDisabled, 'aria-selected':this.selected })
.val( value )
.appendTo( label )
.after('<span>'+title+'</span>');
Expand Down

0 comments on commit de5dc55

Please sign in to comment.