-
Notifications
You must be signed in to change notification settings - Fork 72
[terra-folder-tree] Fix incorrect screenreader announcement of indexes #2106
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified that while walking up/down the folder tree, it announces the level and item index in subset correctly. Looks like expected behavior.
@sycombs - I did some testing with JAWS with the basic folder tree example and it sounds like the issue is fixed. The levels and item index are announced correctly. I will do more testing with other examples. |
* @private | ||
* The position of the item among its sibling items in the same group (subfolder). | ||
*/ | ||
posInSet: PropTypes.number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean position in set
? Can we rename this to positionInSet
or itemPosition
for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was torn between naming it posInSet
, ariaPosInSet
, or positionInSet
as you suggested since this is a direct passthrough to aria-posinset
. I'm not sure which is most appropriate - maybe ariaPosInSet
since it matches the aria attribute?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh if it's a direct passthrough, then yeah, ariaPosInSet
sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated both prop names: eccff30
@sycombs - here are some observations: |
Great work, @sycombs! Those examples are much better and the component is working perfectly! I approved. |
Summary
This PR fixes an issue where screenreaders would announce subfolder items with sibling parents as being part of the same group. This has been done by manually setting the values for
aria-setsize
andaria-posinset
instead of relying on browser calculations.Testing
This change was tested using:
Tested with Voiceover and JAWS.
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-10283
Thank you for contributing to Terra.
@cerner/terra