I am adding aria-label to row on row click event by using event.currentTarget object of onClick(event, index) method. content of the aria-label is not being reading by the Voice over. I tested on both chrome and safari browser Voice over keeps ignoring the aria-label content on selected row.
Content of the aria-label is having text " Row selected ". the purpose of adding aria-label dynamically onClick on row is to make voiceover to read the row as row selected onClick of row.
If add aria-label to tr tag during declaration like below Voice over reads the aria-label content of selected row as expected instead of row cell contents.
<tr role="row" aria-selected={isSelected} aria-label="row selected"/>
isSelected is boolean variable which will set true on row selection.
But when I try to add aria-label dynamically on click of row voice over is not reading the aria-label content even though Dom element is updated with aria-label attribute on click of row.
Please help me in resolving this voice over issue.
I tried adding aria-live="assertive" and aria-live="polite" attributes to like bellow
<tr role="row" aria-selected={isSelected} aria-live="assertive"/>
When I add aria-live voice over first reads cell content and then it reads aria-label contents. but this results in voice over being read row as Cell contents followed by Row selected
instead of reading it as Row selected followed by cell Content
and another issue that I am facing if I use aria-live attribute on row than it reads the previously selected row cell content when i select new row. this is because i am removing aria-label onBlur event of row since row is updated on onBlur is previous row Voice over reads the previous row content as well.
So Please let me know if there is any other work-arround to make voiceover to read the content of aria-label that is added on click of row.
role="row"
andaria-selected="true"
on the row, that will provide the correct context for screenreader users. What you're doing is too verbose and overworking the accessibility. Additionally, VO often ignoresaria-label
on non-focusable items. – Jason"Additionally, VO often ignores aria-label on non-focusable items"
. I'm not sure that's an accurate statement. aria-label might be ignored if the element doesn't have a role but should have nothing to do with the element being focusable. See "2.10 Practical Support: aria-label, aria-labelledby and aria-describedby" at w3.org/TR/using-aria/#label-support – slugoliciousaria-label
andsvg
not being announced unless htesvg
is the child of a focusable element. – Jason