Skip to content
This repository has been archived by the owner on Jul 9, 2018. It is now read-only.

Commit

Permalink
fix(o-mdc-button) fix ripple not working on btn's
Browse files Browse the repository at this point in the history
  • Loading branch information
RomuloCintra committed Dec 15, 2017
1 parent 9bb4f2f commit 9e363c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/components/o-mdc-button/o-mdc-button.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
@import '@material/button/mdc-button';
:host {}
@import "@material/button/mdc-button";

:host{
.mdc-button {
.mdc-icon {
@extend .mdc-button__icon;
}
}
}
7 changes: 4 additions & 3 deletions src/components/o-mdc-button/o-mdc-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class MdcButtonComponent {

private ripple : any;

@Element()MdcButtonEl : HTMLElement;
@Element()el : HTMLElement;
@Prop()name : string;
@Prop()id : string;
@Prop()href : string;
Expand All @@ -21,8 +21,9 @@ export class MdcButtonComponent {
@Prop()dense : boolean;
@Prop()compact : boolean;

componentWillUnload() {
this.ripple = MDCRipple.attachTo(this.MdcButtonEl.shadowRoot.querySelector('.mdc-button'));
componentDidLoad() {
const rootEl = this.el.shadowRoot.querySelector('.mdc-button');
this.ripple = new MDCRipple(rootEl);
}

componentDidUnload() {
Expand Down

0 comments on commit 9e363c9

Please sign in to comment.