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

Minor accessibility issue: Incorrect use of ARIA role in Lists #1464

Open
matsaaj opened this issue Jan 21, 2025 · 2 comments
Open

Minor accessibility issue: Incorrect use of ARIA role in Lists #1464

matsaaj opened this issue Jan 21, 2025 · 2 comments

Comments

@matsaaj
Copy link
Contributor

matsaaj commented Jan 21, 2025

What's wrong?

Both <UnorderedList> and <OrderedList> incorrectly add role="list" to the HTML list element.

As <ul> and <ol> already are list elements, adding role="list" is unnecessary and can potentially cause screen readers to announce the element twice.

How to reproduce?

Steps to reproduce the behavior:

  1. Go to https://spor.vy.no/components/lists
  2. Inspect the HTML output for <UnorderedList> and <OrderedList>
@alicemacl
Copy link
Contributor

alicemacl commented Feb 13, 2025

Har undersøkt dette, og kan ikke reprodusere feilen. Kan du legge ved et videoeksempel?

list-vo.mov

(video er fra en annen branch, men får samme i main i spor)

@matsaaj
Copy link
Contributor Author

matsaaj commented Feb 13, 2025

Har undersøkt dette, og kan ikke reprodusere feilen. Kan du legge ved et videoeksempel?

list-vo.mov
(video er fra en annen branch, men får samme i main i spor)

Feilen ligger i eksempelet ditt hvis du ser i koden til høyre: <ul role="list">.
role="list" er ikke nødvendig her siden det er implisitt for <ul>- og <ol>-elementer.

Jeg har heller ikke sett at det skaper noen feil med VoiceOver, og sannsynligvis vil det ikke føre til UU-problemer, men w3 anbefaler å unngå unødvendige roles - 3.2 Avoid specifying redundant roles

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

2 participants