department-of-veterans-affairs / vets-design-system-documentation

Repository for design.va.gov website
https://design.va.gov
59 stars 65 forks source link

Table sorting - screen reader not announcing on sort #3538

Open ataker opened 2 days ago

ataker commented 2 days ago

Description

Continuation of Table sorting - accessibility fixes #3455. Per the previous ticket:

Screen readers (all) - does not announce when the table is sorted. Currently, it sorts, but then reads out the button's new title attribute. We have aria-live="polite" SR text in there, but I believe focusing the button is overriding the reading of that text. I believe we do that because of a re-render of the table. We do want to maintain focus on the button, but I'm not sure how we can avoid re-rendering.

NVDA + Firefox & Narrator + Edge - sorting the table will repeat the table description "this is a sortable table with 5 rows and 8 columns", then reads the button title. I believe this is also from re-rendering.

In my testing, I wasn't able to get the aria-live="polite" text to announce even after removing the button focusing. My guess is something about the re-render is causing the aria-live="polite" to be considered a new element instead of an updated element, so it is not announced.

Tasks