the widget will be disabled when I invoke the disable method in version 1.0a2.
but in 1.0a3, It's just add the disable css class and still could be clicked/touched.
I check the source code on https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.forms.checkboxradio.js#L58
It looks like the listener does not do the check first.
Good catch We need to check to make sure we're handling disabling correctly on all form widgets.
Can you describe the issue in a bit more detail?
When you say "It's just add the disable css class and still could be clicked/touched" do you mean that it will still register the click or that the .ui-btn-down and .ui-btn-up classes will be applied? What specifically are you expecting to have happen when the radio/checkbox is disabled?
If you have some insight here that I'm missing feel free to chime in, I've been playing for a bit without finding any issue.
I just took our full set of form elements and added the disabled attribute:
Checks and radios actually seem to be some of the better ones - they look disabled (% opacity) though you can click them so we might want to prevent all mouse events.
Looks like text inputs/textareas need the ui-disabled class but they aren't interactive.
The slider handle and flip switch fully works so that needs the ui-disabled class and for us to kill interactivity.
Selects need the ui-disabled class but they aren't interactive.
I know this is a bit beyond the scope of this ticket (feel free to make separate ones if you want) but we should just go through and fix these all up for RC1. Should be pretty straightforward.
Looks like this issue had been resolved in the later version:)
I means the "disable" function just add a "disabled[true]" attribute to the related checkbox and add a disable css class to the widget, in the other side, it dosen't prevent the click operation when user click on the widget.
you could see it in
Thank you both, I'll should be able to handle it from here. I've created a separate ticket for to go through each form element and make sure they behave properly when disabled: #2541.