Skip to content

Commit 8d6a9ae

Browse files
devversionjosephperrott
authored andcommitted
fix(chips): ripples still showing up when globally disabled (#11918)
1 parent 8a9a8bc commit 8d6a9ae

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/lib/chips/chip.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,25 @@ export class MatChipTrailingIcon {}
114114
})
115115
export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDestroy, CanColor,
116116
CanDisable, CanDisableRipple, RippleTarget {
117+
118+
/** Reference to the RippleRenderer for the chip. */
119+
private _chipRipple: RippleRenderer;
120+
121+
/** Whether the ripples are globally disabled through the RippleGlobalOptions */
122+
private _ripplesGloballyDisabled = false;
123+
117124
/**
118125
* Ripple configuration for ripples that are launched on pointer down.
119126
* @docs-private
120127
*/
121128
rippleConfig: RippleConfig = {};
122129

123-
/** Reference to the RippleRenderer for the chip. */
124-
private _chipRipple: RippleRenderer;
125-
126130
/**
127131
* Whether ripples are disabled on interaction
128132
* @docs-private
129133
*/
130134
get rippleDisabled(): boolean {
131-
return this.disabled || this.disableRipple;
135+
return this.disabled || this.disableRipple || this._ripplesGloballyDisabled;
132136
}
133137

134138
/** Whether the chip has focus. */
@@ -225,6 +229,8 @@ export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDes
225229
this._chipRipple.setupTriggerEvents(_elementRef.nativeElement);
226230

227231
if (globalOptions) {
232+
this._ripplesGloballyDisabled = !!globalOptions.disabled;
233+
// TODO(paul): Once the speedFactor is removed, we no longer need to copy each single option.
228234
this.rippleConfig = {
229235
speedFactor: globalOptions.baseSpeedFactor,
230236
animation: globalOptions.animation,

src/lib/tabs/tab-nav-bar/tab-nav-bar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ export class MatTabLink extends _MatTabLinkMixinBase
227227
this.tabIndex = parseInt(tabIndex) || 0;
228228

229229
if (globalOptions) {
230+
// TODO(paul): Once the speedFactor is removed, we no longer need to copy each single option.
230231
this.rippleConfig = {
231232
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
232233
speedFactor: globalOptions.baseSpeedFactor,

0 commit comments

Comments
 (0)