Skip to content

Commit

Permalink
fix(chips): ripples still showing up when globally disabled (#11918)
Browse files Browse the repository at this point in the history
  • Loading branch information
devversion authored and victoriaaa234 committed Jul 25, 2018
1 parent 27f55f2 commit 3d1ee03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/lib/chips/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,25 @@ export class MatChipTrailingIcon {}
})
export class MatChip extends _MatChipMixinBase implements FocusableOption, OnDestroy, CanColor,
CanDisable, CanDisableRipple, RippleTarget {

/** Reference to the RippleRenderer for the chip. */
private _chipRipple: RippleRenderer;

/** Whether the ripples are globally disabled through the RippleGlobalOptions */
private _ripplesGloballyDisabled = false;

/**
* Ripple configuration for ripples that are launched on pointer down.
* @docs-private
*/
rippleConfig: RippleConfig = {};

/** Reference to the RippleRenderer for the chip. */
private _chipRipple: RippleRenderer;

/**
* Whether ripples are disabled on interaction
* @docs-private
*/
get rippleDisabled(): boolean {
return this.disabled || this.disableRipple;
return this.disabled || this.disableRipple || this._ripplesGloballyDisabled;
}

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

if (globalOptions) {
this._ripplesGloballyDisabled = !!globalOptions.disabled;
// TODO(paul): Once the speedFactor is removed, we no longer need to copy each single option.
this.rippleConfig = {
speedFactor: globalOptions.baseSpeedFactor,
animation: globalOptions.animation,
Expand Down
1 change: 1 addition & 0 deletions src/lib/tabs/tab-nav-bar/tab-nav-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export class MatTabLink extends _MatTabLinkMixinBase
this.tabIndex = parseInt(tabIndex) || 0;

if (globalOptions) {
// TODO(paul): Once the speedFactor is removed, we no longer need to copy each single option.
this.rippleConfig = {
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
speedFactor: globalOptions.baseSpeedFactor,
Expand Down

0 comments on commit 3d1ee03

Please sign in to comment.