Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

1.3.2 -> 1.4.3: Disabling checkboxes not working anymore #7598

Closed
lukaseckert opened this issue Jul 30, 2014 · 2 comments
Closed

1.3.2 -> 1.4.3: Disabling checkboxes not working anymore #7598

lukaseckert opened this issue Jul 30, 2014 · 2 comments

Comments

@lukaseckert
Copy link

After migration from 1.3.2 to 1.4.3, the code to disable checkboxes does not work anymore:

$('#box1').prop('disabled', true).checkboxradio('refresh');

The checkbox cannot be clicked anymore, but the style is not adjusted (still looks like an enabled checkbox). When the checkbox is already disabled in the static HTML code from the server, the disabled styles are applied.

I've prepared two JSFiddles with the same code:
http://jsfiddle.net/gXgQ7/1/ (jQuery 1.9.1, jQM 1.3.2, working)
http://jsfiddle.net/S6fpr (jQuery 2.1.0, jQM 1.4.3 not working)

Tested on Chrome 36.0.1985.125, Windows 7

@gabrielschulhof
Copy link

@lukaseckert Dang! This is a regression! Fortunately, there's an alternative way of disabling a checkbox:

$( "#my-checkbox" ).checkboxradio( "option", "disabled", newValue );

This will take care of both the prop and the appearance.

@paulie4
Copy link

paulie4 commented Jun 26, 2015

This is not correctly fixed, since for some reason, other parts of the checkboxradio code look at a separate options.disabled instead of just looking at the element's disabled property. The fix correctly sets or unsets the "ui-state-disabled" class, but the separate options.disabled property is not being updated. Here's an example showing a non-disabled checkboxradio that acts as if it's not being clicked because of the incorrect state of options.disabled:
http://jsfiddle.net/1jvLr3hv/3/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants