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 @@ -384,11 +384,11 @@ describe('MdCheckbox', () => {
384
384
385
385
describe ( 'state transition css classes' , ( ) => {
386
386
it ( 'should transition unchecked -> checked -> unchecked' , ( ) => {
387
- testComponent . isChecked = true ;
387
+ inputElement . click ( ) ;
388
388
fixture . detectChanges ( ) ;
389
389
expect ( checkboxNativeElement . classList ) . toContain ( 'mat-checkbox-anim-unchecked-checked' ) ;
390
390
391
- testComponent . isChecked = false ;
391
+ inputElement . click ( ) ;
392
392
fixture . detectChanges ( ) ;
393
393
expect ( checkboxNativeElement . classList )
394
394
. 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
}
@@ -348,6 +346,8 @@ export class MdCheckbox implements ControlValueAccessor {
348
346
349
347
if ( ! this . disabled ) {
350
348
this . toggle ( ) ;
349
+ this . _transitionCheckState (
350
+ this . _checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
351
351
352
352
// Emit our custom change event if the native input emitted one.
353
353
// 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