@@ -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' ;
@@ -90,8 +91,18 @@ export abstract class MatListItemBase implements AfterContentInit, OnDestroy, Ri
90
91
private _listBase : MatListBase , private _platform : Platform ,
91
92
@Optional ( ) @Inject ( MAT_RIPPLE_GLOBAL_OPTIONS )
92
93
globalRippleOptions ?: RippleGlobalOptions ) {
94
+ // We have to clone the object, because we don't want to mutate a global value when we assign
95
+ // the `animation` further down. The downside of doing this is that the ripple renderer won't
96
+ // pick up dynamic changes to `disabled`, but it's not something we officially support.
97
+ this . rippleConfig = { ...( globalRippleOptions || { } ) } ;
93
98
this . _hostElement = this . _elementRef . nativeElement ;
94
- this . rippleConfig = globalRippleOptions || { } ;
99
+
100
+ if ( ! this . rippleConfig . animation ) {
101
+ this . rippleConfig . animation = {
102
+ enterDuration : numbers . DEACTIVATION_TIMEOUT_MS ,
103
+ exitDuration : numbers . FG_DEACTIVATION_MS
104
+ } ;
105
+ }
95
106
96
107
if ( ! this . _listBase . _isNonInteractive ) {
97
108
this . _initInteractiveListItem ( ) ;
0 commit comments