Skip to content

Commit d2eefac

Browse files
allan-chencopybara-github
authored andcommitted
fix(button): render nullable attr types properly
PiperOrigin-RevId: 404094757
1 parent b733dcb commit d2eefac

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/button/lib/button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export abstract class Button extends LitElement {
3636

3737
@property({type: String}) label = '';
3838

39-
@property({type: String}) ariaLabel = '';
39+
@property({type: String}) ariaLabel!: string;
4040

4141
@property({type: Boolean}) hasIcon = false;
4242

components/button/lib/link-button.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type LinkTarget = '_blank'|'_parent'|'_self'|'_top';
1515

1616
/** @soyCompatible */
1717
export abstract class LinkButton extends Button {
18-
@property({type: String}) href = '';
18+
@property({type: String}) href!: string;
1919

20-
@property({type: String}) target = '';
20+
@property({type: String}) target!: string;
2121

2222
/**
2323
* @soyTemplate
@@ -36,7 +36,7 @@ export abstract class LinkButton extends Button {
3636
@touchend="${this.handleRippleDeactivate}"
3737
@touchcancel="${this.handleRippleDeactivate}"><!--
3838
--><a class="md3-button ${classMap(this.getRenderClasses())}"
39-
href="${this.href}"
39+
href="${ifDefined(this.href)}"
4040
target="${ifDefined(this.target as LinkTarget)}"
4141
aria-label="${ifDefined(this.ariaLabel)}"><!--
4242
-->${this.renderFocusRing()}<!--

0 commit comments

Comments
 (0)