Skip to content

Commit

Permalink
Merge pull request #5752 from vdegenne:icon-button-href
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 702387438
  • Loading branch information
copybara-github committed Dec 3, 2024
2 parents 045fe94 + ea1134a commit 735b3cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions iconbutton/internal/_shared.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@
}

.link {
display: grid;
height: 100%;
outline: none;
place-items: center;
position: absolute;
width: 100%;
}
Expand Down
7 changes: 4 additions & 3 deletions iconbutton/internal/icon-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
${this.renderRipple()}
${!this.selected ? this.renderIcon() : nothing}
${this.selected ? this.renderSelectedIcon() : nothing}
${this.renderTouchTarget()}
${this.href && this.renderLink()}
${this.href ? this.renderLink() : this.renderTouchTarget()}
</${tag}>`;
}

Expand All @@ -193,7 +192,9 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
id="link"
href="${this.href}"
target="${this.target || nothing}"
aria-label="${ariaLabel || nothing}"></a>
aria-label="${ariaLabel || nothing}">
${this.renderTouchTarget()}
</a>
`;
}

Expand Down

0 comments on commit 735b3cc

Please sign in to comment.