File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -356,11 +356,11 @@ describe('MdCheckbox', () => {
356
356
357
357
describe ( 'state transition css classes' , ( ) => {
358
358
it ( 'should transition unchecked -> checked -> unchecked' , ( ) => {
359
- testComponent . isChecked = true ;
359
+ inputElement . click ( ) ;
360
360
fixture . detectChanges ( ) ;
361
361
expect ( checkboxNativeElement . classList ) . toContain ( 'mat-checkbox-anim-unchecked-checked' ) ;
362
362
363
- testComponent . isChecked = false ;
363
+ inputElement . click ( ) ;
364
364
fixture . detectChanges ( ) ;
365
365
expect ( checkboxNativeElement . classList )
366
366
. not . toContain ( 'mat-checkbox-anim-unchecked-checked' ) ;
Original file line number Diff line number Diff line change @@ -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
}
@@ -342,6 +340,8 @@ export class MdCheckbox implements ControlValueAccessor {
342
340
343
341
if ( ! this . disabled ) {
344
342
this . toggle ( ) ;
343
+ this . _transitionCheckState (
344
+ this . _checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
345
345
346
346
// Emit our custom change event if the native input emitted one.
347
347
// It is important to only emit it, if the native input triggered one, because
You can’t perform that action at this time.
0 commit comments