Skip to content

Commit cf84a27

Browse files
author
pennin
committed
fix: remove the input entirely and replace it with a touch target
1 parent 192f17e commit cf84a27

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

radio/internal/_radio.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,13 @@ $_md-sys-motion: tokens.md-sys-motion-values();
8989
);
9090
}
9191

92-
// <input> is also the touch target
93-
input {
94-
appearance: none;
92+
.touch-target {
9593
height: 48px;
96-
margin: 0;
9794
position: absolute;
9895
width: 48px;
99-
cursor: inherit;
10096
}
10197

102-
:host([touch-target='none']) input {
98+
:host([touch-target='none']) .touch-target {
10399
width: 100%;
104100
height: 100%;
105101
}

radio/internal/radio.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class Radio extends radioBaseClass {
9999
protected override render() {
100100
const classes = {'checked': this.checked};
101101
return html`
102-
<div class="container ${classMap(classes)}" inert">
102+
<div class="container ${classMap(classes)}" aria-hidden="true">
103103
<md-ripple
104104
part="ripple"
105105
.control=${this}
@@ -119,13 +119,7 @@ export class Radio extends radioBaseClass {
119119
<circle class="inner circle" cx="10" cy="10" r="5" />
120120
</svg>
121121
122-
<input
123-
id="input"
124-
type="radio"
125-
tabindex="-1"
126-
.checked=${this.checked}
127-
.value=${this.value}
128-
?disabled=${this.disabled} />
122+
<div class="touch-target"></div>
129123
</div>
130124
`;
131125
}

0 commit comments

Comments
 (0)