Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in validating <li> in wrapped <ul> #10997

Closed
ronaldtveen opened this issue Jun 19, 2020 · 1 comment
Closed

Error in validating <li> in wrapped <ul> #10997

ronaldtveen opened this issue Jun 19, 2020 · 1 comment

Comments

@ronaldtveen
Copy link

We're currently in development of a websites that is under NDA so I cannot link to that page, removed the URL from the screenshots because of that reason.
It is a WordPress website with the The7 theme, which we use on many websites so I will link to a couple of those. They all have the same accessibility error which is not correct. They however are not optimised as much as the screenshots I will attach at the bottom of the website that we want/need to get to 100% accessibility score (government website that has accessibility demands).

Provide the steps to reproduce

We get an incorrect error when we scan for: Categories: Accessibility for Device: Desktop in Lighthouse.

What is the current behavior?

We're getting the following accessibility error:

List items (<li>) are not contained within <ul> or <ol> parent elements.
Screen readers require list items (<li>) to be contained within a parent <ul> or <ol> to be announced properly. Learn more.

What is the expected behavior?

This is incorrect because when we click on the failing elements we see the <li> wrapped in a <ul> element. We see this both in the DOM (DevTools) as well as in the original generated HTML from the server (View » Developer » View Source)

Environment Information

  • Affected Channels: DevTools, Axe
  • Lighthouse version: 5.7.1
  • Chrome version: 83.0.4103.106 (Official Build) (64-bit)
  • Node.js version: ---
  • Operating System: macOS Version 10.15.5 (Build 19F96)

Related

  1. Lighthouse screenshot
    This shows the single error; Hovering the second <li> element in Lighthouse which highlights the element in the main navigation in the header.

  2. Axe screenshot
    Shows the same error. Note that the #primary-menu ID is a <ul> element...

  3. DOM screenshot
    Shows the <li>'s being wrapped in the <ul id="primary-menu"> in the DOM

  4. Source screenshot
    Shows the <li>'s being wrapped in the <ul id="primary-menu"> in the HTML source

@patrickhulce
Copy link
Collaborator

Thanks for filing @neejoh! The problem is your role=navigation on the ul which, from an a11y perspective makes it no longer a list container.

See #9643 for more discussion on this issue.

If you have any further comments on this issue, feel free to take it up in axe-core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants