Skip to content

Commit 7ffbc4f

Browse files
committed
Make sure animation for indeterminate change only if indeterminate value changes
1 parent c2b0971 commit 7ffbc4f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/lib/checkbox/checkbox.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,14 @@ export class MdCheckbox implements ControlValueAccessor {
215215
set indeterminate(indeterminate: boolean) {
216216
let changed = indeterminate != this._indeterminate;
217217
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+
224219
if (changed) {
220+
if (this._indeterminate) {
221+
this._transitionCheckState(TransitionCheckState.Indeterminate);
222+
} else {
223+
this._transitionCheckState(
224+
this.checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked);
225+
}
225226
this.indeterminateChange.emit(this._indeterminate);
226227
}
227228
}
@@ -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

Comments
 (0)