input-missing-label reports no label when both label and input are hidden
When both label and input are hidden from the accessibility tree by some means, input-missing-label reports that the input label does not have content. In our case, we use visibility: hidden;
style on a collapsed section of content. There
Reduced test-case
<div style="visibility: hidden;">
<label for="test-input">
Some label
</label>
<input id="test-input" type="text">
</div>
Configuration
{
"rules": {
"input-missing-label": "error"
}
}
Expected result
I would expect the HTML to be valid, since both the label and input are hidden via the same means.
Actual result
What happened instead?
Got error:
5:8 error <input> element has <label> but <label> has no text input-missing-label
Version
-
html-validate
: 8.13.0
Note that it did not fail in version 8.4.0.