File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ describe('MdCheckbox', () => {
388
388
testComponent . isIndeterminate = true ;
389
389
fixture . detectChanges ( ) ;
390
390
391
- testComponent . isChecked = true ;
391
+ inputElement . click ( ) ;
392
392
fixture . detectChanges ( ) ;
393
393
394
394
expect ( checkboxNativeElement . classList ) . not . toContain (
Original file line number Diff line number Diff line change @@ -215,13 +215,14 @@ export class MdCheckbox implements ControlValueAccessor {
215
215
set indeterminate ( indeterminate : boolean ) {
216
216
let changed = indeterminate != this . _indeterminate ;
217
217
this . _indeterminate = indeterminate ;
218
- if ( this . _indeterminate ) {
219
- this . _transitionCheckState ( TransitionCheckState . Indeterminate ) ;
220
- } else {
221
- this . _transitionCheckState (
222
- this . checked ? TransitionCheckState . Checked : TransitionCheckState . Unchecked ) ;
223
- }
218
+
224
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
+ }
225
226
this . indeterminateChange . emit ( this . _indeterminate ) ;
226
227
}
227
228
}
@@ -377,6 +378,8 @@ export class MdCheckbox implements ControlValueAccessor {
377
378
// [checked] bound to it.
378
379
if ( newState === TransitionCheckState . Checked ) {
379
380
animSuffix = 'unchecked-checked' ;
381
+ } else if ( newState == TransitionCheckState . Indeterminate ) {
382
+ animSuffix = 'unchecked-indeterminate' ;
380
383
} else {
381
384
return '' ;
382
385
}
You can’t perform that action at this time.
0 commit comments