GoogleChrome / GoogleChrome/lighthouse

WordPress Comments box causing Lighthouse to incorrectly report an error

Open
#13,679 3 comments 0 reactions 0 assignees View on GitHub
docs P3
Dominant language
JavaScript
Stars
30.8k
Forks
9.8k
Avg merge
1d 14h
Merged PRs (30d)
20

Description

### FAQ

- [X] Yes, my issue is not about [variability](https://github.com/GoogleChrome/lighthouse/blob/master/docs/variability.md) or [throttling](https://github.com/GoogleChrome/lighthouse/blob/master/docs/throttling.md).
- [X] Yes, my issue is not about a specific accessibility audit (file with [axe-core](https://github.com/dequelabs/axe-core) instead).

### URL

https://www.americanroadtrips.net/route-66/monument-valley-the-grand-canyon/

### What happened?

Lighthouse Device Mode: Desktop and Mobile
Error reported by Lighthouse is: “Form elements do not have associated labels”

Error details
Reported in Accessibility
Failing Elements: textarea#comment

This is the HTML for the Comment form:

`

`
`Comment *`
``
``
...
`

`

So there IS a label on the comments form, but Lighthouse is saying there is not. So an error is being reported when it should not be. At least that's what it looks like to me....

### What did you expect?

Not to have Lighthouse report an error.

### What have you tried?

I looked at the HTML and found a 'label' associated with the 'textarea' element that Lighthouse reports as in error.

**Please note:** there is another 'textarea' element immediately after the default WordPress 'textarea'. This is a hidden element added by the Antispam Bee plugin to prevent spam and bots from auto-filling the form. I have deactivated this plugin to remove this line of code on a temporary / test basis - but the Lighthouse error is still reported.

Furthermore, the ‘textarea#comment’ under Failing Elements is a hyperlink to the code Lighthouse thinks is a problem. If you click on that hyperlink, you get transferred to the Elements tab of Dev Tools, wherein the HTML code is displayed. It then automatically goes to the line of ‘problem’ code and highlights it in light blue - and it is NOT the Antispam Bee line that’s highlighted, but the WordPress comment box, e.g.
``
The Antispam Bee line is never flagged by Lighthouse as being a problem.

### How were you running Lighthouse?

Chrome DevTools

### Lighthouse Version

9.1.0

### Chrome Version

Version 98.0.4758.82 (Official Build) (64-bit)

### Node Version

_No response_

### OS

Windows 10

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.