@@ -29,6 +29,7 @@ import {
29
29
RippleTarget ,
30
30
setLines ,
31
31
} from '@angular/material-experimental/mdc-core' ;
32
+ import { numbers } from '@material/ripple' ;
32
33
import { Subscription } from 'rxjs' ;
33
34
import { startWith } from 'rxjs/operators' ;
34
35
import { MatListAvatarCssMatStyler , MatListIconCssMatStyler } from './list-styling' ;
@@ -91,8 +92,18 @@ export abstract class MatListItemBase implements AfterContentInit, OnDestroy, Ri
91
92
private _listBase : MatListBase , private _platform : Platform ,
92
93
@Optional ( ) @Inject ( MAT_RIPPLE_GLOBAL_OPTIONS )
93
94
globalRippleOptions ?: RippleGlobalOptions ) {
95
+ // We have to clone the object, because we don't want to mutate a global value when we assign
96
+ // the `animation` further down. The downside of doing this is that the ripple renderer won't
97
+ // pick up dynamic changes to `disabled`, but it's not something we officially support.
98
+ this . rippleConfig = { ...( globalRippleOptions || { } ) } ;
94
99
this . _hostElement = this . _elementRef . nativeElement ;
95
- this . rippleConfig = globalRippleOptions || { } ;
100
+
101
+ if ( ! this . rippleConfig . animation ) {
102
+ this . rippleConfig . animation = {
103
+ enterDuration : numbers . DEACTIVATION_TIMEOUT_MS ,
104
+ exitDuration : numbers . FG_DEACTIVATION_MS
105
+ } ;
106
+ }
96
107
97
108
if ( ! this . _listBase . _isNonInteractive ) {
98
109
this . _initInteractiveListItem ( ) ;
0 commit comments