Skip to content

Commit af2de37

Browse files
authored
Move htmlFor to correct label in FieldInline (#913)
1 parent 79d2f3e commit af2de37

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [UNRELEASED]
9+
10+
### Fixed
11+
12+
- `FieldInline` `for` attribute moved to the correct `label`
13+
814
## [0.7.30] - 2020-05-07
915

1016
### Added

packages/components/src/Form/Fields/FieldCheckbox/__snapshots__/FieldCheckbox.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ exports[`A FieldCheckbox 1`] = `
9797
9898
<label
9999
className="c0 "
100+
htmlFor="FieldCheckboxID"
100101
>
101102
<span
102103
className="c1 c2"
103104
color="palette.charcoal700"
104105
fontSize="xsmall"
105106
fontWeight="semiBold"
106-
htmlFor="FieldCheckboxID"
107107
>
108108
👍
109109
</span>
@@ -247,13 +247,13 @@ exports[`A FieldCheckbox with checked value 1`] = `
247247
248248
<label
249249
className="c0 "
250+
htmlFor="FieldCheckboxID"
250251
>
251252
<span
252253
className="c1 c2"
253254
color="palette.charcoal700"
254255
fontSize="xsmall"
255256
fontWeight="semiBold"
256-
htmlFor="FieldCheckboxID"
257257
>
258258
👍
259259
</span>

packages/components/src/Form/Fields/FieldInline.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const FieldInlineLayout: FC<Omit<
5454
validationMessage,
5555
}) => {
5656
return (
57-
<label className={className}>
58-
<Label as="span" fontSize={labelFontSize} htmlFor={id}>
57+
<label className={className} htmlFor={id}>
58+
<Label as="span" fontSize={labelFontSize}>
5959
{label}
6060
{required && <RequiredStar />}
6161
</Label>

packages/components/src/Form/Fields/FieldRadio/__snapshots__/FieldRadio.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ exports[`A FieldRadio 1`] = `
102102
103103
<label
104104
className="c0 "
105+
htmlFor="FieldRadioID"
105106
>
106107
<span
107108
className="c1 c2"
108109
color="palette.charcoal700"
109110
fontSize="xsmall"
110111
fontWeight="semiBold"
111-
htmlFor="FieldRadioID"
112112
>
113113
👍
114114
</span>
@@ -238,13 +238,13 @@ exports[`A FieldRadio checked 1`] = `
238238
239239
<label
240240
className="c0 "
241+
htmlFor="FieldRadioID"
241242
>
242243
<span
243244
className="c1 c2"
244245
color="palette.charcoal700"
245246
fontSize="xsmall"
246247
fontWeight="semiBold"
247-
htmlFor="FieldRadioID"
248248
>
249249
👍
250250
</span>

packages/components/src/Form/Fields/FieldToggleSwitch/__snapshots__/FieldToggleSwitch.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ exports[`A FieldToggleSwitch 1`] = `
8484
8585
<label
8686
className="c0 "
87+
htmlFor="FieldToggleSwitchID"
8788
>
8889
<span
8990
className="c1 c2"
9091
color="palette.charcoal700"
9192
fontSize="xsmall"
9293
fontWeight="semiBold"
93-
htmlFor="FieldToggleSwitchID"
9494
>
9595
👍
9696
</span>
@@ -209,13 +209,13 @@ exports[`A FieldToggleSwitch turned on 1`] = `
209209
210210
<label
211211
className="c0 "
212+
htmlFor="FieldToggleSwitchID"
212213
>
213214
<span
214215
className="c1 c2"
215216
color="palette.charcoal700"
216217
fontSize="xsmall"
217218
fontWeight="semiBold"
218-
htmlFor="FieldToggleSwitchID"
219219
>
220220
👍
221221
</span>

0 commit comments

Comments
 (0)