tailwindlabs / tailwindui-issues

A place to report bugs discovered in Tailwind UI.
236 stars 4 forks source link

HTML <ul> using aria list role #1444

Closed mirhamasala closed 1 year ago

mirhamasala commented 1 year ago

What component (if applicable)

Describe the bug The components use HTML<ul> and role="list"

To Reproduce Steps to reproduce the behavior:

  1. Go to https://tailwindui.com/components/application-ui/lists/stacked-lists
  2. Click on the code tab for any stacked list component
  3. Find <ul>
  4. See role="list"

Expected behavior role="list" shouldn't be necessary when using <ul>

Screenshots

Screenshot 2023-04-13 at 14 16 55

Additional context https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/list_role

adamwathan commented 1 year ago

Hey! So role=“list” is necessary when setting list-style-type: none otherwise certain screen readers won’t treat the element like a list:

https://www.scottohara.me/blog/2019/01/12/lists-and-safari.html

Hope that helps!

mirhamasala commented 1 year ago

@adamwathan Totally helps. Thank you.