tangled
alpha
login
or
join now
mary.my.id
/
boat
22
fork
atom
handy online tools for AT Protocol
boat.kelinci.net
atproto
bluesky
atcute
typescript
solidjs
22
fork
atom
overview
issues
pulls
pipelines
feat: allow disabling radio options
mary.my.id
1 year ago
b01fa221
71f52567
verified
This commit was signed with the committer's
known signature
.
mary.my.id
SSH Key Fingerprint:
SHA256:ZlTP/auFSGpGnaoDg4mCTG1g9OZvXp62jWR4c6H4O3c=
+4
-4
1 changed file
expand all
collapse all
unified
split
src
components
inputs
radio-input.tsx
+4
-4
src/components/inputs/radio-input.tsx
···
10
10
name?: string;
11
11
required?: boolean;
12
12
value?: T;
13
13
-
options: { value: NoInfer<T>; label: string }[];
13
13
+
options: { value: NoInfer<T>; label: string; disabled?: boolean }[];
14
14
onChange?: (next: NoInfer<T>, event: BoundInputEvent<HTMLInputElement>) => void;
15
15
}
16
16
···
26
26
<span class="font-semibold text-gray-600">{props.label}</span>
27
27
</legend>
28
28
29
29
-
{props.options.map(({ value, label }, idx) => {
29
29
+
{props.options.map(({ value, label, disabled }, idx) => {
30
30
const optionId = fieldId + idx;
31
31
32
32
return (
33
33
-
<span class="flex items-center gap-3">
33
33
+
<fieldset disabled={disabled} class="flex items-center gap-3 disabled:opacity-50">
34
34
<input
35
35
type="radio"
36
36
id={optionId}
···
45
45
<label for={optionId} class="text-sm">
46
46
{label}
47
47
</label>
48
48
-
</span>
48
48
+
</fieldset>
49
49
);
50
50
})}
51
51