@@ -39,7 +39,6 @@ import {
3939 RippleRef ,
4040} from '@angular/material/core' ;
4141import { MAT_CHECKBOX_CLICK_ACTION , MatCheckboxClickAction } from './checkbox-config' ;
42- import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations' ;
4342
4443
4544// Increasing integer for generating unique ids for checkbox components.
@@ -109,7 +108,6 @@ export const _MatCheckboxMixinBase =
109108 '[class.mat-checkbox-checked]' : 'checked' ,
110109 '[class.mat-checkbox-disabled]' : 'disabled' ,
111110 '[class.mat-checkbox-label-before]' : 'labelPosition == "before"' ,
112- '[class._mat-animation-noopable]' : `_animationMode === 'NoopAnimations'` ,
113111 } ,
114112 providers : [ MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR ] ,
115113 inputs : [ 'disableRipple' , 'color' , 'tabIndex' ] ,
@@ -186,8 +184,7 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
186184 private _focusMonitor : FocusMonitor ,
187185 @Attribute ( 'tabindex' ) tabIndex : string ,
188186 @Optional ( ) @Inject ( MAT_CHECKBOX_CLICK_ACTION )
189- private _clickAction : MatCheckboxClickAction ,
190- @Optional ( ) @Inject ( ANIMATION_MODULE_TYPE ) public _animationMode ?: string ) {
187+ private _clickAction : MatCheckboxClickAction ) {
191188 super ( elementRef ) ;
192189
193190 this . tabIndex = parseInt ( tabIndex ) || 0 ;
@@ -325,11 +322,7 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
325322 if ( ! this . _focusRipple && focusOrigin === 'keyboard' ) {
326323 this . _focusRipple = this . ripple . launch ( 0 , 0 , { persistent : true } ) ;
327324 } else if ( ! focusOrigin ) {
328- if ( this . _focusRipple ) {
329- this . _focusRipple . fadeOut ( ) ;
330- this . _focusRipple = null ;
331- }
332-
325+ this . _removeFocusRipple ( ) ;
333326 this . _onTouched ( ) ;
334327 }
335328 }
@@ -397,11 +390,6 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
397390
398391 private _getAnimationClassForCheckStateTransition (
399392 oldState : TransitionCheckState , newState : TransitionCheckState ) : string {
400- // Don't transition if animations are disabled.
401- if ( this . _animationMode === 'NoopAnimations' ) {
402- return '' ;
403- }
404-
405393 let animSuffix : string = '' ;
406394
407395 switch ( oldState ) {
@@ -432,4 +420,12 @@ export class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAc
432420
433421 return `mat-checkbox-anim-${ animSuffix } ` ;
434422 }
423+
424+ /** Fades out the focus state ripple. */
425+ private _removeFocusRipple ( ) : void {
426+ if ( this . _focusRipple ) {
427+ this . _focusRipple . fadeOut ( ) ;
428+ this . _focusRipple = null ;
429+ }
430+ }
435431}
0 commit comments