Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 76d4270

Browse files
committed
Adding proper label attributes for a11y in docs. Addresses #825
1 parent 6839b4d commit 76d4270

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

docs/api/Control.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ class App extends React.Component {
5555
render() {
5656
return (
5757
<form>
58-
<label>Name:</label>
59-
<Control.text model="user.name" />
58+
<label htmlFor="user.name">Name:</label>
59+
<Control.text model="user.name" id="user.name" />
6060

61-
<label>Favorite color:</label>
62-
<Control.select model="user.faveColor">
61+
<label htmlFor="user.faveColor">Favorite color:</label>
62+
<Control.select model="user.faveColor" id="user.faveColor">
6363
<option value="red">red</option>
6464
<option value="green">green</option>
6565
<option value="blue">blue</option>

docs/guides/quickstart.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@ class UserForm extends React.Component {
9292
}
9393
render() {
9494
return (
95-
<Form model="user"
96-
onSubmit={(user) => this.handleSubmit(user)}>
97-
<label>First name:</label>
98-
<Control.text model="user.firstName" />
99-
100-
<label>Last name:</label>
101-
<Control.text model="user.lastName" />
95+
<Form
96+
model="user"
97+
onSubmit={(user) => this.handleSubmit(user)}
98+
>
99+
<label htmlFor="user.firstName">First name:</label>
100+
<Control.text model="user.firstName" id="user.firstName" />
101+
102+
<label htmlFor="user.lastName">Last name:</label>
103+
<Control.text model="user.lastName" id="user.lastName" />
102104

103105
<button type="submit">
104106
Finish registration!

0 commit comments

Comments
 (0)