I'm working on making my single page HTML5 application more screen reader friendly. The basic structure of the app features static headerbar and navigation menu, and a "main" div element that displays large chunks of dynamically changed "page" data.
Currently I've added the aria-live="assertive"
attribute to the main div so that, when the user triggers an event that changes the content of the page, the screen reader will stop reading old content and begin reading new content.
Some of the "pages" feature heavy usage of visual data (charts, graphs, tables), so to relay the data to screen readers more effectively I've used the pattern of hiding a visual element, and instead relaying the info via off screen text.
This works fine when I open the browser and navigate straight to the state these elements are displayed in. However, if I start elsewhere in the application and navigate to this content, NVDA will read the content which should be hidden.
<div id="main" aria-live="assertive">
...
<div class="offscreen"> Text describing chart </div>
<div class="chart" aria-hidden="true"> Graphically drawn chart data... </div>
...
</div>
My current best guess is that aria-live is taking precedence over aria-hidden somehow, but was hoping someone would have some more experience, or a better pattern for achieving the desired behavior. I have tried another common technique which involves focusing on the page's heading element after content is rendered, but when doing so NVDA reads only that header, rather than the entirety of the live page content.
(Note: I'm testing using NVDA and FireFox.)