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

Allowance of presentational li elements inside a list #3935

Closed
Al-Dani opened this issue Mar 7, 2023 · 3 comments
Closed

Allowance of presentational li elements inside a list #3935

Al-Dani opened this issue Mar 7, 2023 · 3 comments
Labels
feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label

Comments

@Al-Dani
Copy link

Al-Dani commented Mar 7, 2023

Product

axe-core

Feature Description

Is it possible to include role=presentation to the list of allowed roles for the <li> inside <ul>?
Having a presentational element won't interrupt the user while navigating through a list, as it will be removed from the a11y tree.

A use-case for this is to have a navigation list with separators between items. Separators are decorative.

@Al-Dani Al-Dani added feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label labels Mar 7, 2023
@Al-Dani
Copy link
Author

Al-Dani commented Mar 9, 2023

That's what I want to achieve:

<ul> 
 <li> <a/> </li>
 <li> <a/> </li>
 <li role='presentation'> <hr/> </li>
 <li> <a/> </li>
 <li> <a/> </li>
</ul>

@WilcoFiers
Copy link
Contributor

WilcoFiers commented Mar 14, 2023

Putting role=presentation on an li means the li is hidden, but its content is not. You should use aria-hidden="true" instead if you want it ignored.

@straker
Copy link
Contributor

straker commented Nov 17, 2023

Closing as answered. Further information about using the hr element (or equivalent role) in a list can be found at w3c/aria#1889.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or enhancement ungroomed Ticket needs a maintainer to prioritize and label
Projects
None yet
Development

No branches or pull requests

3 participants