Skip to content

Commit

Permalink
fix(button): Replace <mwc-icon> with <md-icon>
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 467836166
  • Loading branch information
kvizcarra authored and copybara-github committed Aug 16, 2022
1 parent a88be95 commit 8720a77
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions button/lib/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import '@material/mwc-icon/mwc-icon';
import '@material/web/icon/icon';
import '@material/web/focus/focus-ring';
import '@material/web/ripple/ripple';

Expand All @@ -15,6 +15,7 @@ import {ariaProperty} from '@material/web/decorators/aria-property';
import {pointerPress, shouldShowStrongFocus} from '@material/web/focus/strong-focus';
import {MdRipple} from '@material/web/ripple/ripple';
import {ARIAHasPopup} from '@material/web/types/aria';
import {html as staticHtml, literal} from 'lit/static-html';
import {html, TemplateResult} from 'lit';
import {property, query, queryAssignedElements, state} from 'lit/decorators';
import {ClassInfo, classMap} from 'lit/directives/class-map';
Expand All @@ -27,6 +28,8 @@ export abstract class Button extends ActionElement implements ButtonState {
static override shadowRootOptions:
ShadowRootInit = {mode: 'open', delegatesFocus: true};

protected readonly iconTag = literal`md-icon`;

// TODO(b/210730484): replace with @soyParam annotation
@property({type: String, attribute: 'data-aria-has-popup', noAccessor: true})
@ariaProperty // tslint:disable-line:no-new-decorators
Expand Down Expand Up @@ -159,13 +162,12 @@ export abstract class Button extends ActionElement implements ButtonState {
</span>`;
}

// TODO: investigate removing this
/** @soyTemplate */
protected renderFontIcon(): TemplateResult {
return html`
<mwc-icon class="md3-button__icon">
return staticHtml`
<${this.iconTag} class="md3-button__icon">
${this.icon}
</mwc-icon>`;
</${this.iconTag}>`;
}

override update(changedProperties: Map<string, string>) {
Expand Down

0 comments on commit 8720a77

Please sign in to comment.