Skip to content

Commit 1ad4c45

Browse files
committed
increase default depth 3 -> 5
1 parent 6476e56 commit 1ad4c45

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
@@ -178,7 +178,7 @@ export default {
178178
'label-has-associated-control': {
179179
labelComponents: ['CustomInputLabel'],
180180
controlComponents: ['CustomInput'],
181-
depth: 3,
181+
depth: 5,
182182
}
183183
}
184184
}
@@ -188,7 +188,7 @@ export default {
188188

189189
- `labelComponents` is a list of Svelte component names that should be checked for an associated control.
190190
- `controlComponents` is a list of Svelte component names that will output an input element.
191-
- `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.
191+
- `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.
192192

193193
---
194194

src/compiler/compile/utils/a11y.ts

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

200200
function traverse_children(

0 commit comments

Comments
 (0)