react icon indicating copy to clipboard operation
react copied to clipboard

[TreeView] Add an explicit `aria-label` to SubTree `ul` elements for Safari VoiceOver support

Open strackoverflow opened this issue 1 year ago • 2 comments

Description

This came up from an accessibility audit of one of our internal components which makes use of TreeView. (GitHub staff link for more context: https://github.com/github/collaboration-workflows-flex/issues/1190).

It looks like the TreeView.SubTree component needs an aria-label on its ul element in order for Safari's VoiceOver screenreader to properly describe the nested list. This label should just be equivalent to the parent item's accessible name.

This seems like something we could automatically set on all SubTrees so they are VoiceOver compatible, but if there's some reason why we wouldn't want to do this across the board, we could at least add a prop to pass in an aria-label to the SubTree. I'm curious to hear if there's an opinion one way or the other on that 🤔

Steps to reproduce

  1. Create a nested sub-tree at least 3 levels deep
  2. When navigating to the first child item of the nested parent item, VoiceOver reads the text of the parent item, not the focused item

Version

v36.27.0

Browser

Safari

strackoverflow avatar Sep 26 '24 16:09 strackoverflow

Thanks for letting us know!

We're actively working on PRC accessibility remediation right now in https://github.com/github/primer/issues/3453. @TylerJDev should we add this Sev 2 to https://github.com/github/primer/issues/3555, assuming this issue hasn't already been catalogued?

lesliecdubs avatar Sep 26 '24 16:09 lesliecdubs

@lesliecdubs, yes we can! I've added this in the batch linked, under severity-2 issues. Should be able to tackle this alongside the other TreeView issues.

TylerJDev avatar Sep 26 '24 19:09 TylerJDev

@strackoverflow, I've created a PR (https://github.com/primer/react/pull/5174) that adds aria-label as a prop for subtree. I'm trying to think of an accessible way to do this automatically. We could grab the name from the parent ListItems, but I'm not too sure how we can determine how to "shorten" the accessible name automatically, (e.g. Add a new "Alien" type to the game to Add a new "Alien" type) without it being a manual thing.

TylerJDev avatar Oct 24 '24 23:10 TylerJDev

@TylerJDev thanks! Yeah, I'm not sure how we could do this automatically either. I wonder if just using the parent item's full accessible name on the list would be enough to unblock the VoiceOver issue?

strackoverflow avatar Oct 28 '24 21:10 strackoverflow

@strackoverflow, we could! I'm thinking this might cause some redundancy since I believe it'll repeat the item it was last on, at least for other SRs 🤔

Tagging @ericwbailey for any additional thoughts!

TylerJDev avatar Nov 07 '24 14:11 TylerJDev

I thiiiiiiiiiink NVDA and JAWS' heuristics will only single announce if the string and the aria-label match, so that might be a case for doing it automatically and not using a manual prop.

Happy to check this out with AT if there's a place I can access outside of the github/github org.

ericwbailey avatar Nov 07 '24 16:11 ericwbailey

Sorry for the delay here! I'll follow up with the guidance here, and test with NVDA/JAWS!

TylerJDev avatar Dec 02 '24 23:12 TylerJDev

Description

This came up from an accessibility audit of one of our internal components which makes use of TreeView. (GitHub staff link for more context: https://github.com/github/collaboration-workflows-flex/issues/1190).

It looks like the TreeView.SubTree component needs an aria-label on its ul element in order for Safari's VoiceOver screenreader to properly describe the nested list. This label should just be equivalent to the parent item's accessible name.

This seems like something we could automatically set on all SubTrees so they are VoiceOver compatible, but if there's some reason why we wouldn't want to do this across the board, we could at least add a prop to pass in an aria-label to the SubTree. I'm curious to hear if there's an opinion one way or the other on that 🤔

Steps to reproduce

  1. Create a nested sub-tree at least 3 levels deep
  2. When navigating to the first child item of the nested parent item, VoiceOver reads the text of the parent item, not the focused item

Version

v36.27.0

Browser

Safari

pauly31 avatar Dec 22 '24 07:12 pauly31

Bjkvjjnjij

pauly31 avatar Dec 22 '24 07:12 pauly31

/ Thought 🤔

pauly31 avatar Dec 22 '24 07:12 pauly31

Thanks for letting us know!

We're actively working on PRC accessibility remediation right now in https://github.com/github/primer/issues/3453. @TylerJDev should we add this Sev 2 to https://github.com/github/primer/issues/3555, assuming this issue hasn't already been catalogued?

ghanta chiiiiiiiiiiiiiiDuplicate of #5549 /

Sunita1986 avatar Jan 16 '25 12:01 Sunita1986

/ Thought 🤔

1. >

$$$$$###!@#@###%bhosaaaaa

Sunita1986 avatar Jan 16 '25 12:01 Sunita1986

@TylerJDev I see you were the last commenter here with plans to follow up with guidance, so I've assigned you to the ticket. If you need support to figure out where this fits in your priorities, don't hesitate to reach out to me.

lesliecdubs avatar Jan 16 '25 17:01 lesliecdubs