FSWebDevBook / speedscore-dev

This the author's sandbox repo for the SpeedScore personal speedgolf app developed in the book.
0 stars 0 forks source link

Should main navigation list items have role of none? #6

Open anevins12 opened 3 years ago

anevins12 commented 3 years ago

Should list items inside the main navigation menu have role of none?

As the <ul> element is being repurposed using a role of menu, should the semantic role of the list item elements also be removed? Otherwise users of AT would hear 'list item' unexpectedly and that could be confusing. More info: https://www.w3.org/TR/wai-aria-practices/#presentation_role

b6473812-5a83-4e81-ad00-45357175098e

chundhau commented 3 years ago

@anevins12: Here's how I am defining list items presently:

`

  • Post to Feed
  • ` As you can see, `
  • ` items are defined with `role=none`. After reexamining the W3C pattern, I think I can actually remove the `` tags inside the `
  • ` tags and just define the `
  • ` elements as having `role=menuitem` instead. Does that sound reasonable to you?
  • chundhau commented 3 years ago

    I have updated index.html as described in the above comment, i.e., I have removed the child <a> tags. This required some tweaks to the JavaScript but it is all working fine now.