Skip to content

Commit 2707a31

Browse files
authored
Merge branch 'master' into 690-fix
2 parents 27ff089 + 79559b8 commit 2707a31

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<p align="center">
2-
<a href="https://travis-ci.org/evcohen/eslint-plugin-jsx-a11y">
3-
<img src="https://api.travis-ci.org/evcohen/eslint-plugin-jsx-a11y.svg?branch=master"
2+
<a href="https://travis-ci.com/github/jsx-eslint/eslint-plugin-jsx-a11y">
3+
<img src="https://travis-ci.com/jsx-eslint/eslint-plugin-jsx-a11y.svg?branch=master"
44
alt="build status">
55
</a>
66
<a href="https://npmjs.org/package/eslint-plugin-jsx-a11y">

__tests__/src/rules/label-has-associated-control-test.js

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ const nestingValid = [
4848
{ code: '<label><span><span><span><span>A label</span><input /></span></span></span></label>', options: [{ depth: 5 }] },
4949
{ code: '<label><span><span><span><span aria-label="A label" /><input /></span></span></span></label>', options: [{ depth: 5 }] },
5050
{ code: '<label><span><span><span><input aria-label="A label" /></span></span></span></label>', options: [{ depth: 5 }] },
51+
// Other controls
52+
{ code: '<label>foo<meter /></label>' },
53+
{ code: '<label>foo<output /></label>' },
54+
{ code: '<label>foo<progress /></label>' },
55+
{ code: '<label>foo<textarea /></label>' },
5156
// Custom controlComponents.
5257
{ code: '<label><span>A label<CustomInput /></span></label>', options: [{ controlComponents: ['CustomInput'] }] },
5358
{ code: '<CustomLabel><span>A label<CustomInput /></span></CustomLabel>', options: [{ controlComponents: ['CustomInput'], labelComponents: ['CustomLabel'] }] },

src/rules/label-has-associated-control.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,14 @@ module.exports = {
5757
if (componentNames.indexOf(elementType(node.openingElement)) === -1) {
5858
return;
5959
}
60-
const controlComponents = ['input', 'select', 'textarea'].concat((options.controlComponents || []));
60+
const controlComponents = [
61+
'input',
62+
'meter',
63+
'output',
64+
'progress',
65+
'select',
66+
'textarea',
67+
].concat((options.controlComponents || []));
6168
// Prevent crazy recursion.
6269
const recursionDepth = Math.min(
6370
options.depth === undefined ? 2 : options.depth,

0 commit comments

Comments
 (0)