-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdCheckbox: wrong display state when using ngChecked #1550
Comments
Related: check validity after the #1006 refactor |
Confirmed, there's a not operator on the checked var inside the apply: checkbox.js:123 scope.$apply(function() {
checked = !checked;
ngModelCtrl.$setViewValue(checked, ev && ev.type);
ngModelCtrl.$render();
}); Removing the ! has fixed it for me, don't know what the intention of it was and I unfortunately don't have the time to take a more in depth look, sorry! Hope this helps though. Thanks guys. |
@ThomasBurleson It doesn't look like 942d0b9 fixed the demo in my initial post. |
@ngraef - switch |
I have re-opened to investigate issues with |
@ThomasBurleson Interesting, but that gives |
So the underlying issue is that the A few possible fixes with varying degrees of cleanliness:
|
@ngraef - the above is very helpful. Thank you. |
CodePen example: http://codepen.io/anon/pen/zxWrGP?editors=101
In the example,
ngChecked
andngClick
are used to track a list of multiple selected items. ThemdCheckbox
es display correct state when the model is manipulated by the standard checkboxes. However, after interacting with themdCheckbox
es, their display state is reversed. Using the standard checkboxes again fixes themdCheckbox
state.(Related:
ngChecked
initially implemented for #535)The text was updated successfully, but these errors were encountered: