1
0
mirror of https://github.com/phuoc-ng/csslayout.git synced 2025-08-08 15:16:52 +02:00

Link <label for> to <input id>. Fixes #137

This commit is contained in:
André Jaenisch
2020-06-09 19:03:27 +02:00
parent 7c6afbb80d
commit 66fe84871e
6 changed files with 14 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ const Details: React.FC<{}> = () => {
}}
>
<label
htmlFor="radio-switch-first"
style={{
backgroundColor: isFirstChecked ? '#357EDD' : '',
borderRadius: '9999px',
@@ -53,6 +54,7 @@ const Details: React.FC<{}> = () => {
}}
>
<input
id="radio-switch-first"
type="radio"
style={{ display: 'none' }}
checked={isFirstChecked}
@@ -68,6 +70,7 @@ const Details: React.FC<{}> = () => {
/>
</label>
<label
htmlFor="radio-switch-second"
style={{
backgroundColor: isFirstChecked ? '' : '#357EDD',
borderRadius: '9999px',
@@ -77,6 +80,7 @@ const Details: React.FC<{}> = () => {
}}
>
<input
id="radio-switch-second"
type="radio"
style={{ display: 'none' }}
checked={!isFirstChecked}