Skip to content

Commit 1f19804

Browse files
joyzhongcopybara-github
authored andcommitted
chore(iconbutton): Modify link icon button syntax.
PiperOrigin-RevId: 404792275
1 parent 18065d2 commit 1f19804

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/icon-button/lib/link-icon-button.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ type LinkTarget = '_blank'|'_parent'|'_self'|'_top';
2222
export class LinkIconButton extends IconButtonBase {
2323
@property({type: String}) linkHref = '';
2424

25-
// Default to empty string so that in the generated Wit Soy template, by
26-
// default `linkTarget` is falsy and the `target` attribute is not printed.
27-
@property({type: String}) linkTarget = '';
25+
@property({type: String}) linkTarget!: string;
2826

2927
/** @soyTemplate */
3028
protected override render(): TemplateResult {
@@ -44,7 +42,7 @@ export class LinkIconButton extends IconButtonBase {
4442
><slot></slot
4543
></span>
4644
<a class="mdc-icon-button__link" href="${this.linkHref}"
47-
target="${ifDefined(this.linkTarget) as LinkTarget}" aria-label="${
45+
target="${ifDefined(this.linkTarget as LinkTarget)}" aria-label="${
4846
this.ariaLabel || this.icon}"></a>
4947
</div>`;
5048
}

0 commit comments

Comments
 (0)