Skip to content

Commit ea1134a

Browse files
committed
fix(iconbutton): href will respond to touch target
1 parent e217185 commit ea1134a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

iconbutton/internal/_shared.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,10 @@
9292
}
9393

9494
.link {
95+
display: grid;
9596
height: 100%;
9697
outline: none;
98+
place-items: center;
9799
position: absolute;
98100
width: 100%;
99101
}

iconbutton/internal/icon-button.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,7 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
179179
${this.renderRipple()}
180180
${!this.selected ? this.renderIcon() : nothing}
181181
${this.selected ? this.renderSelectedIcon() : nothing}
182-
${this.renderTouchTarget()}
183-
${this.href && this.renderLink()}
182+
${this.href ? this.renderLink() : this.renderTouchTarget()}
184183
</${tag}>`;
185184
}
186185

@@ -193,7 +192,9 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
193192
id="link"
194193
href="${this.href}"
195194
target="${this.target || nothing}"
196-
aria-label="${ariaLabel || nothing}"></a>
195+
aria-label="${ariaLabel || nothing}">
196+
${this.renderTouchTarget()}
197+
</a>
197198
`;
198199
}
199200

0 commit comments

Comments
 (0)