New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
3 participants
@lukaseckert

lukaseckert commented Jul 30, 2014

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

This comment has been minimized.

Show comment
Hide comment
@gabrielschulhof

gabrielschulhof Jul 30, 2014

Contributor

@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.

Contributor

gabrielschulhof commented Jul 30, 2014

@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

This comment has been minimized.

Show comment
Hide comment
@paulie4

paulie4 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/

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 join this conversation on GitHub. Already have an account? Sign in to comment