-
Notifications
You must be signed in to change notification settings - Fork 791
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: separate form-field-multiple-label from label rule (#1226)
- Loading branch information
Showing
8 changed files
with
133 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"id": "form-field-multiple-labels", | ||
"selector": "input, select, textarea", | ||
"matches": "label-matches.js", | ||
"tags": [ | ||
"cat.forms", | ||
"wcag2a", | ||
"wcag332" | ||
], | ||
"metadata": { | ||
"description": "Ensures form field does not have multiple label elements", | ||
"help": "Form field must not have multiple label elements" | ||
}, | ||
"all": [], | ||
"any": [], | ||
"none": [ | ||
"multiple-label" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
], | ||
"none": [ | ||
"help-same-as-label", | ||
"multiple-label", | ||
"hidden-explicit-label" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
["#fail10"], | ||
["#fail11"], | ||
["#fail22"], | ||
["#fail23"], | ||
["#fail24"], | ||
["#fail25"], | ||
["#fail26"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!-- Fail --> | ||
<label for="fail1">Hi</label> | ||
<label for="fail1">Foo</label> | ||
<input type="text" id="fail1"> | ||
|
||
<label for="fail2">label one</label> | ||
<label for="fail2">label two</label> | ||
<input type="checkbox" id="fail2"> | ||
|
||
<label for="fail3" id="l1">label one</label> | ||
<label for="fail3">label two</label> | ||
<input type="checkbox" id="fail3" aria-labelledby="l1"> | ||
|
||
<label for="fail4">First Name:</label> | ||
<label>First Name: | ||
<input type="text" id="fail4"> | ||
</label> | ||
|
||
<label for="fail5">Choose an option:</label> | ||
<label> | ||
Choose an option: | ||
<select id="fail5"> | ||
<option selected="selected">Chosen</option> | ||
<option>Not Selected</option> | ||
</select> | ||
</label> | ||
|
||
<label for="fail6">Enter your comments:</label> | ||
<label> | ||
Enter your comments: | ||
<textarea id="fail6"></textarea> | ||
</label> | ||
|
||
<label> | ||
Enter your comments: | ||
<label> | ||
Enter your comments: | ||
<textarea id="fail7"></textarea> | ||
</label> | ||
</label> | ||
|
||
<label> | ||
Enter your comments: | ||
<label> | ||
Enter your comments: | ||
<label> | ||
Enter your comments: | ||
<textarea id="fail8"></textarea> | ||
</label> | ||
</label> | ||
</label> | ||
|
||
<label for="fail9">Enter your comments:</label> | ||
<label> | ||
Enter your comments: | ||
<label> | ||
Enter your comments: | ||
<label> | ||
Enter your comments: | ||
<textarea id="fail9"></textarea> | ||
</label> | ||
</label> | ||
</label> | ||
|
||
<!-- Pass --> | ||
<label for="pass1">Label</label> | ||
<input type="text" id="pass1"> | ||
|
||
<textarea id="pass2" title="Label"></textarea> | ||
|
||
<label>First Name: | ||
<input type="text" id="pass3"> | ||
</label> | ||
|
||
<label> | ||
Choose an option: | ||
<select id="pass4"> | ||
<option selected="selected">Chosen</option> | ||
<option>Not Selected</option> | ||
</select> | ||
</label> | ||
|
||
<label> | ||
Enter your comments: | ||
<textarea id="pass5"></textarea> | ||
</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"description": "form-field-multiple-labels label test", | ||
"rule": "form-field-multiple-labels", | ||
"violations": [ | ||
["#fail1"], | ||
["#fail2"], | ||
["#fail3"], | ||
["#fail4"], | ||
["#fail5"], | ||
["#fail6"], | ||
["#fail7"], | ||
["#fail8"], | ||
["#fail9"] | ||
], | ||
"passes": [ | ||
["#pass1"], | ||
["#pass2"], | ||
["#pass3"], | ||
["#pass4"], | ||
["#pass5"] | ||
] | ||
} |