fix(label-title-only): allow hidden labels#3183
fix(label-title-only): allow hidden labels#3183straker merged 1 commit intodequelabs:developfrom macjohnny:fix-arialabelledby-hidden
Conversation
straker
left a comment
There was a problem hiding this comment.
I'm wondering if we should instead update the labelVirtual code to no check if the aria-labelledby element is visible. I'll get back to you once I've had a chance to talk to @WilcoFiers about it.
I tried that as an alternative, however, the build failed when trying to use arialabelledbyText inside labelVirtual |
straker
left a comment
There was a problem hiding this comment.
Alright, talked to Wilco and we decided that aria-hidden labels should pass, but visually hidden labels should not. That means we can just remove the true argument in the visualVirtual call in labelVirtual.
return vNode ? visibleVirtual(vNode) : '';In conjunction with that change, we should update the description to the label-title-only rule to state what the rule is really looking for: that the element has a visual label.
"description": "Ensures that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes",|
Ok, will update the PR soon |
|
@straker updated the PR according to your suggestions, please take a look :) |
straker
left a comment
There was a problem hiding this comment.
Great! Thanks for the pr and the updates.
|
Reviewed for security |
take into account labels with
aria-hidden="true"when evaluating thelabel-title-onlyrule.Closes issue:
fixes #3174