mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-17 21:01:00 +00:00
Allow checkboxes and radio buttons to be selected with the keyboard
This commit is contained in:
parent
a4ee2d5bbb
commit
4ca2fc5287
1 changed files with 9 additions and 2 deletions
|
|
@ -58,8 +58,8 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
}
|
||||
|
||||
self._cacheVals();
|
||||
|
||||
input.attr( "checked", inputtype === "radio" && true || !input.is( ":checked" ) );
|
||||
|
||||
input.attr( "checked", inputtype === "radio" && true || !(input.attr("checked")) );
|
||||
|
||||
// input set for common radio buttons will contain all the radio
|
||||
// buttons, but will not for checkboxes. clearing the checked status
|
||||
|
|
@ -79,6 +79,13 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
|
|||
},
|
||||
|
||||
vclick: function(){
|
||||
// adds checked attribute to checked input when keyboard is used
|
||||
if ($(this).is(":checked")) {
|
||||
$(this).attr( "checked", true);
|
||||
self._getInputSet().not($(this)).removeAttr('checked');
|
||||
} else {
|
||||
$(this).removeAttr("checked");
|
||||
}
|
||||
self._updateAll();
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue