Skip to content

Commit e187594

Browse files
annieywwagnermaciel
authored andcommitted
fix(material-experimental/mdc-button): add mdc ripple class for fab (#21923)
(cherry picked from commit 088a756)
1 parent 48bd3e4 commit e187594

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

src/material-experimental/mdc-button/button-base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ export class MatButtonBase extends _MatButtonBaseMixin implements CanDisable, Ca
101101
/** Whether the ripple is centered on the button. */
102102
_isRippleCentered = false;
103103

104+
/** Whether this button is a FAB. Used to apply the correct class on the ripple. */
105+
_isFab = false;
106+
104107
/** Reference to the MatRipple instance of the button. */
105108
@ViewChild(MatRipple) ripple: MatRipple;
106109

src/material-experimental/mdc-button/button.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<span class="mdc-button__ripple"></span>
1+
<span
2+
[class.mdc-button__ripple]="!_isFab"
3+
[class.mdc-fab__ripple]="_isFab"></span>
24

35
<ng-content select=".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd])">
46
</ng-content>

src/material-experimental/mdc-button/fab.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export class MatFabButton extends MatButtonBase {
6363
// The FAB by default has its color set to accent.
6464
color = 'accent' as ThemePalette;
6565

66+
_isFab = true;
67+
6668
private _extended: boolean;
6769
get extended(): boolean { return this._extended; }
6870
set extended(value: boolean) { this._extended = coerceBooleanProperty(value); }
@@ -95,6 +97,8 @@ export class MatMiniFabButton extends MatButtonBase {
9597
// The FAB by default has its color set to accent.
9698
color = 'accent' as ThemePalette;
9799

100+
_isFab = true;
101+
98102
constructor(
99103
elementRef: ElementRef, platform: Platform, ngZone: NgZone,
100104
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {

0 commit comments

Comments
 (0)