Skip to content

Commit 409c98c

Browse files
committed
Do not destroy the ripple when it is disabled
1 parent 4021276 commit 409c98c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

src/demo-app/button/button-demo.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,8 @@
101101
<button md-button>Check<md-icon class="md-24">favorite</md-icon></button>
102102
<button md-button>Last<md-icon>navigate_before</md-icon></button>
103103
</section>
104+
<section>
105+
<button md-raised-button [disabled]="toggleDisable" (click)="toggleDisable = true">Disable</button>
106+
<button md-button [disabled]="!toggleDisable" (click)="toggleDisable = false">Disable</button>
107+
</section>
104108
</div>

src/demo-app/button/button-demo.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ import {Component} from '@angular/core';
1010
export class ButtonDemo {
1111
isDisabled: boolean = false;
1212
clickCounter: number = 0;
13+
toggleDisable: boolean = false;
1314
}

src/lib/button/button.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<span class="mat-button-wrapper"><ng-content></ng-content></span>
2-
<div md-ripple *ngIf="!_isRippleDisabled()" class="mat-button-ripple"
2+
<div md-ripple class="mat-button-ripple"
33
[class.mat-button-ripple-round]="_isRoundButton || _isIconButton"
4+
[mdRippleDisabled]="_isRippleDisabled()"
45
[mdRippleCentered]="_isIconButton"
56
[mdRippleTrigger]="_getHostElement()"></div>
67
<!-- the touchstart handler prevents the overlay from capturing the initial tap on touch devices -->

0 commit comments

Comments
 (0)