Skip to content

Commit b66934e

Browse files
committed
increase default depth 3 -> 5
1 parent 8201d76 commit b66934e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

site/content/docs/06-accessibility-warnings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default {
190190
'label-has-associated-control': {
191191
labelComponents: ['CustomInputLabel'],
192192
controlComponents: ['CustomInput'],
193-
depth: 3,
193+
depth: 5,
194194
}
195195
}
196196
}
@@ -200,7 +200,7 @@ export default {
200200

201201
- `labelComponents` is a list of Svelte component names that should be checked for an associated control.
202202
- `controlComponents` is a list of Svelte component names that will output an input element.
203-
- `depth` (default 3, max 25) is an integer that determines how deep within the label element the rule should look for an element to determine if the label element has associated control.
203+
- `depth` (default 5, max 25) is an integer that determines how deep within the label element the rule should look for an element to determine if the label element has associated control.
204204

205205
---
206206

src/compiler/compile/utils/a11y.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function contains_input_child(
179179
rule_options: CompileOptions['a11y']['rules']['label-has-associated-control']
180180
): boolean {
181181
// magic number inspired from https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/rules/label-has-associated-control.js
182-
const max_depth = Math.min(rule_options?.depth ?? 3, 25);
182+
const max_depth = Math.min(rule_options?.depth ?? 5, 25);
183183
const additional_component_names = rule_options?.controlComponents;
184184

185185
function traverse_children(

0 commit comments

Comments
 (0)