@@ -195,8 +195,6 @@ export class MdCheckbox implements ControlValueAccessor {
195
195
this . indeterminateChange . emit ( this . _indeterminate ) ;
196
196
}
197
197
this . _checked = checked ;
198
- this . _transitionCheckState (
199
- this . _checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
200
198
this . _changeDetectorRef . markForCheck ( ) ;
201
199
}
202
200
}
@@ -217,13 +215,14 @@ export class MdCheckbox implements ControlValueAccessor {
217
215
set indeterminate ( indeterminate : boolean ) {
218
216
let changed = indeterminate != this . _indeterminate ;
219
217
this . _indeterminate = indeterminate ;
220
- if ( this . _indeterminate ) {
221
- this . _transitionCheckState ( TransitionCheckState . Indeterminate ) ;
222
- } else {
223
- this . _transitionCheckState (
224
- this . checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
225
- }
218
+
226
219
if ( changed ) {
220
+ if ( this . _indeterminate ) {
221
+ this . _transitionCheckState ( TransitionCheckState . Indeterminate ) ;
222
+ } else {
223
+ this . _transitionCheckState (
224
+ this . checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
225
+ }
227
226
this . indeterminateChange . emit ( this . _indeterminate ) ;
228
227
}
229
228
}
@@ -348,6 +347,8 @@ export class MdCheckbox implements ControlValueAccessor {
348
347
349
348
if ( ! this . disabled ) {
350
349
this . toggle ( ) ;
350
+ this . _transitionCheckState (
351
+ this . _checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
351
352
352
353
// Emit our custom change event if the native input emitted one.
353
354
// It is important to only emit it, if the native input triggered one, because
@@ -379,6 +380,8 @@ export class MdCheckbox implements ControlValueAccessor {
379
380
// [checked] bound to it.
380
381
if ( newState === TransitionCheckState . Checked ) {
381
382
animSuffix = 'unchecked-checked' ;
383
+ } else if ( newState == TransitionCheckState . Indeterminate ) {
384
+ animSuffix = 'unchecked-indeterminate' ;
382
385
} else {
383
386
return '' ;
384
387
}
0 commit comments