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
Lighthouse seems to analyze the pages without running JS, so it misses the connection between the <label for="comment"> markup and the real comment form. Because we add the id="comment" with JS afterwards.
usually the connection is between ref on the label and id of the text-area. With aria-properties you can reverse it. So I added aria-labelledby=”comment-lbl” to the first textarea in antispam_bee.php and made a comment-form textarea override in my theme and put an id=”comment-lbl” to the standard label of the text-area. So the label references the hidden textarea with the standard way ref and id and the real textarea is referenced reverse with labelledby and id. This brings 100% score for me in the Lighthouse-Test and I think it probably will not break the spam-protection.
The text was updated successfully, but these errors were encountered:
Reported here: https://wordpress.org/support/topic/accessibility-form-elements-do-not-have-associated-labels-2/#post-16019004
Lighthouse seems to analyze the pages without running JS, so it misses the connection between the
<label for="comment">
markup and the real comment form. Because we add theid="comment"
with JS afterwards.https://github.com/pluginkollektiv/antispam-bee/blob/master/antispam_bee.php#L1259-L1292
A possible solution from the forums:
The text was updated successfully, but these errors were encountered: