Skip to content

Commit

Permalink
fix(tab-nav-bar): ripples still showing up when globally disabled
Browse files Browse the repository at this point in the history
* If someone disables the ripples globally using the `MAT_RIPPLE_GLOBAL_OPTIONS`, the `<mat-tab-nav-bar>` still shows ripples. Ripples should be disabled for that custom `RippleTarget` as well.
* By cloning and reinstalling the whole project, I ran into a runtime exception when running Gulp

Fixes #11847
  • Loading branch information
devversion committed Jun 27, 2018
1 parent 4166d16 commit c30ea86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/lib/tabs/tab-nav-bar/tab-nav-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ export class MatTabLink extends _MatTabLinkMixinBase
/** Reference to the RippleRenderer for the tab-link. */
protected _tabLinkRipple: RippleRenderer;

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

/** Whether the link is active. */
@Input()
get active(): boolean { return this._isActive; }
Expand All @@ -210,7 +213,8 @@ export class MatTabLink extends _MatTabLinkMixinBase
* @docs-private
*/
get rippleDisabled(): boolean {
return this.disabled || this.disableRipple || this._tabNavBar.disableRipple;
return this.disabled || this.disableRipple || this._tabNavBar.disableRipple ||
this._ripplesGloballyDisabled;
}

constructor(private _tabNavBar: MatTabNav,
Expand All @@ -227,6 +231,7 @@ export class MatTabLink extends _MatTabLinkMixinBase
this.tabIndex = parseInt(tabIndex) || 0;

if (globalOptions) {
this._ripplesGloballyDisabled = !!globalOptions.disabled;
// TODO(paul): Once the speedFactor is removed, we no longer need to copy each single option.
this.rippleConfig = {
terminateOnPointerUp: globalOptions.terminateOnPointerUp,
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/tasks/screenshots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function setFileResult(database: Database, prNumber: string, fileName: string, r

/** Sets the full diff result for the current Pull Request that runs inside of Travis. */
function setPullRequestResult(database: Database, prNumber: string, result: boolean) {
return getPullRequestRef(database, prNumber).child('result').child(pullRequestSha).set(result);
return getPullRequestRef(database, prNumber).child('result').child(pullRequestSha!).set(result);
}

/** Returns the Firebase Reference that contains all data related to the specified PR. */
Expand Down

0 comments on commit c30ea86

Please sign in to comment.