You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: '`label` tag should have an associated control and a text content.',
285
+
code: 'a11y-invalid-label',
286
+
title: '`label` element should have an associated control and a text content.',
285
287
message:
286
-
'The `label` tag must be associated with a control using either `for` or having a nested input. Additionally, the `label` tag must have text content.',
287
-
selector: 'label:not([for])',
288
-
match(element){
289
-
constinputChild=element.querySelector('input');
290
-
if(!inputChild?.textContent)returntrue;
288
+
'The `label` element must be associated with a control either by using the `for` attribute or by containing a nested form element. Additionally, the `label` element must have text content.',
289
+
selector: 'label',
290
+
match(element: HTMLLabelElement){
291
+
// Label must be associated with a control, either using `for` or having a nested valid element
0 commit comments