vaadin / web-components

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+
https://vaadin.com/docs/latest/components
447 stars 83 forks source link

TreeGrid expanded/collapsed status not announced by NVDA #5791

Open TatuLund opened 1 year ago

TatuLund commented 1 year ago

What is the problem?

TreeGrid expanded/collapsed status is not announced by NVDA. This is because the "aria-expanded" attribute is set on tr-element, however this is not supported by NVDA, which requires the "aria-expanded" to be in the td-element's in order to be announced.

Browsers

Screen Readers

TatuLund commented 1 year ago

Ideas of workaround with JavaScript call

grid.$.scroller.querySelectorAll("tr[aria-expanded='true']").forEach(tr => tr.children[0].setAttribute('aria-expanded','true'));

grid.$.scroller.querySelectorAll("tr[aria-expanded='false']").forEach(tr => tr.children[0].setAttribute('aria-expanded','false'));