Skip to content

Commit cd7d1e6

Browse files
committed
Fix CI failures
- Use camelCase for aria attributes (ariaLabel, ariaRequired) - Use boolean `true` instead of string "true" for ariaRequired - Fix htmlFor placement inside label tags
1 parent 4e95686 commit cd7d1e6

File tree

3 files changed

+37
-25
lines changed

3 files changed

+37
-25
lines changed
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
@react.component
22
let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmit, ~disabled) => {
3-
<form className="form-horizontal flex flex-col gap-4" onSubmit=handleSubmit disabled={disabled} aria-label="Comment submission form">
3+
<form
4+
className="form-horizontal flex flex-col gap-4"
5+
onSubmit=handleSubmit
6+
disabled={disabled}
7+
ariaLabel="Comment submission form">
48
<div className="flex flex-col gap-0 items-center lg:gap-4 lg:flex-row">
5-
<label htmlFor="comment_author" className="w-full lg:w-2/12 lg:text-end shrink-0"> {"Name"->React.string} </label>
9+
<label htmlFor="comment_author" className="w-full lg:w-2/12 lg:text-end shrink-0">
10+
{"Name"->React.string}
11+
</label>
612
<input
713
type_="text"
814
className="px-3 py-1 leading-4 border border-gray-300 rounded w-full"
@@ -11,12 +17,14 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
1117
id="comment_author"
1218
onChange=handleAuthorChange
1319
value={author}
14-
aria-label="Author name"
15-
aria-required="true"
20+
ariaLabel="Author name"
21+
ariaRequired=true
1622
/>
1723
</div>
1824
<div className="flex flex-col gap-0 items-center lg:gap-4 lg:flex-row">
19-
<label htmlFor="comment_text" className="w-full lg:w-2/12 lg:text-end shrink-0"> {"Text"->React.string} </label>
25+
<label htmlFor="comment_text" className="w-full lg:w-2/12 lg:text-end shrink-0">
26+
{"Text"->React.string}
27+
</label>
2028
<input
2129
type_="text"
2230
className="px-3 py-1 leading-4 border border-gray-300 rounded w-full"
@@ -25,8 +33,8 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
2533
id="comment_text"
2634
onChange=handleTextChange
2735
value={text}
28-
aria-label="Comment text"
29-
aria-required="true"
36+
ariaLabel="Comment text"
37+
ariaRequired=true
3038
/>
3139
</div>
3240
<div className="flex flex-col gap-0 lg:gap-4 lg:flex-row">
@@ -35,8 +43,8 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
3543
type_="submit"
3644
className="self-start px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800"
3745
value="Post"
38-
aria-label="Submit comment"
46+
ariaLabel="Submit comment"
3947
/>
4048
</div>
4149
</form>
42-
}
50+
}

client/app/bundles/comments/rescript/CommentForm/forms/InlineForm.res

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
44
className="form-inline flex flex-col lg:flex-row flex-wrap gap-4"
55
onSubmit=handleSubmit
66
disabled={disabled}
7-
aria-label="Comment submission form">
7+
ariaLabel="Comment submission form">
88
<div className="flex gap-2 items-center">
9-
<label> htmlFor="comment_author" {"Name"->React.string} </label>
9+
<label htmlFor="comment_author"> {"Name"->React.string} </label>
1010
<input
1111
type_="text"
1212
className="px-3 py-1 leading-4 border border-gray-300 rounded"
@@ -15,12 +15,12 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
1515
id="comment_author"
1616
value={author}
1717
onChange=handleAuthorChange
18-
aria-label="Author name"
19-
aria-required="true"
18+
ariaLabel="Author name"
19+
ariaRequired=true
2020
/>
2121
</div>
2222
<div className="flex gap-2 items-center">
23-
<label> htmlFor="comment_text" {"Text"->React.string} </label>
23+
<label htmlFor="comment_text"> {"Text"->React.string} </label>
2424
<input
2525
type_="text"
2626
className="px-3 py-1 leading-4 border border-gray-300 rounded"
@@ -29,17 +29,17 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
2929
id="comment_text"
3030
onChange=handleTextChange
3131
value={text}
32-
aria-label="Comment text"
33-
aria-required="true"
32+
ariaLabel="Comment text"
33+
ariaRequired=true
3434
/>
3535
</div>
3636
<div className="flex gap-2">
3737
<input
3838
type_="submit"
3939
className="self-start px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800"
4040
value="Post"
41-
aria-label="Submit comment"
41+
ariaLabel="Submit comment"
4242
/>
4343
</div>
4444
</form>
45-
}
45+
}

client/app/bundles/comments/rescript/CommentForm/forms/StackedFrom.res

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
@react.component
22
let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmit, ~disabled) => {
3-
<form onSubmit=handleSubmit disabled={disabled} className="flex flex-col gap-4" aria-label="Comment submission form">
3+
<form
4+
onSubmit=handleSubmit
5+
disabled={disabled}
6+
className="flex flex-col gap-4"
7+
ariaLabel="Comment submission form">
48
<div className="flex flex-col gap-0">
59
<label htmlFor="comment_author" className="w-full"> {"Name"->React.string} </label>
610
<input
@@ -11,8 +15,8 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
1115
id="comment_author"
1216
onChange=handleAuthorChange
1317
value={author}
14-
aria-label="Author name"
15-
aria-required="true"
18+
ariaLabel="Author name"
19+
ariaRequired=true
1620
/>
1721
</div>
1822
<div className="flex flex-col gap-0">
@@ -25,17 +29,17 @@ let make = (~author, ~handleAuthorChange, ~text, ~handleTextChange, ~handleSubmi
2529
id="comment_text"
2630
onChange=handleTextChange
2731
value={text}
28-
aria-label="Comment text"
29-
aria-required="true"
32+
ariaLabel="Comment text"
33+
ariaRequired=true
3034
/>
3135
</div>
3236
<div className="flex flex-col gap-0">
3337
<input
3438
type_="submit"
3539
className="self-start px-3 py-1 font-semibold border-0 rounded text-sky-50 bg-sky-600 hover:bg-sky-800"
3640
value="Post"
37-
aria-label="Submit comment"
41+
ariaLabel="Submit comment"
3842
/>
3943
</div>
4044
</form>
41-
}
45+
}

0 commit comments

Comments
 (0)