mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-26 14:53:59 +00:00
remove checked state from radio button inputs that are not checked. use jquery attr accessor instead of expando to guarantee consistent values. Fixes #1532.
This commit is contained in:
parent
d9e47627ed
commit
377c0067a7
1 changed files with 10 additions and 1 deletions
|
|
@ -58,7 +58,14 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
}
|
||||
|
||||
self._cacheVals();
|
||||
|
||||
input.attr( "checked", inputtype === "radio" && true || !input.is( ":checked" ) );
|
||||
|
||||
// input set for common radio buttons will contain all the radio
|
||||
// buttons, but will not for checkboxes. clearing the checked status
|
||||
// of other radios ensures the active button state is applied properly
|
||||
self._getInputSet().not(input).removeAttr('checked');
|
||||
|
||||
self._updateAll();
|
||||
return false;
|
||||
}
|
||||
|
|
@ -116,7 +123,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
label = this.label,
|
||||
icon = label.find( ".ui-icon" );
|
||||
|
||||
if ( input[0].checked ) {
|
||||
// input[0].checked expando doesn't always report the proper value
|
||||
// for checked='checked'
|
||||
if ( $(input[0]).attr('checked') ) {
|
||||
label.addClass( $.mobile.activeBtnClass );
|
||||
icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue