@@ -195,8 +195,6 @@ export class MdCheckbox implements ControlValueAccessor {
195195 this . indeterminateChange . emit ( this . _indeterminate ) ;
196196 }
197197 this . _checked = checked ;
198- this . _transitionCheckState (
199- this . _checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
200198 this . _changeDetectorRef . markForCheck ( ) ;
201199 }
202200 }
@@ -217,13 +215,14 @@ export class MdCheckbox implements ControlValueAccessor {
217215 set indeterminate ( indeterminate : boolean ) {
218216 let changed = indeterminate != this . _indeterminate ;
219217 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+
226219 if ( changed ) {
220+ if ( this . _indeterminate ) {
221+ this . _transitionCheckState ( TransitionCheckState . Indeterminate ) ;
222+ } else {
223+ this . _transitionCheckState (
224+ this . checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
225+ }
227226 this . indeterminateChange . emit ( this . _indeterminate ) ;
228227 }
229228 }
@@ -348,6 +347,8 @@ export class MdCheckbox implements ControlValueAccessor {
348347
349348 if ( ! this . disabled ) {
350349 this . toggle ( ) ;
350+ this . _transitionCheckState (
351+ this . _checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
351352
352353 // Emit our custom change event if the native input emitted one.
353354 // It is important to only emit it, if the native input triggered one, because
@@ -379,6 +380,8 @@ export class MdCheckbox implements ControlValueAccessor {
379380 // [checked] bound to it.
380381 if ( newState === TransitionCheckState . Checked ) {
381382 animSuffix = 'unchecked-checked' ;
383+ } else if ( newState == TransitionCheckState . Indeterminate ) {
384+ animSuffix = 'unchecked-indeterminate' ;
382385 } else {
383386 return '' ;
384387 }
0 commit comments