WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: error messages only announced by Chrome (using NVDA)

for

From: Birkir R. Gunnarsson
Date: Aug 3, 2017 8:26PM


The key to an effective live region is to make sure content inside it changes.
When the content of a live region changes, an event should be fired by
the browser, picked up by the screen reader, and then handled
according to the aria-live and aria-atomic attributes.
<div aria-live="assertive" aria-atomic="true"> content goes here </div>
means that if you update this content, (either add text or add an
element) the entire content is read.
If you use aria-live="assertive" by itself (the value of aria-atomic
is false) only the content you changed or added is read.

What you cannot do is insert an element indo the DOM that already has
aria-live="assertive". This is because the content inside the div with
aria-live has to change in order for the content to be announced.
If you inject the element with aria-live into the document, no changes
occurred inside the element, so nothing is announced.
I have a bunch of working JavaScript examples, I can dig around
tomorrow, but Tim's example should work (knowing his work it probably
orks better than mine).
But just remember, to trigger a live region announcement you either
have to add content or change the content inside the element with
aria-live.
I guess the problem in your case is that you are inserting the elemeng
with aria-live and the content into the document (in which case no
live region updates took place).




On 8/3/17, Angela French < <EMAIL REMOVED> > wrote:
> I didn't read for me until I tabbed off of the test button after having
> clicked it.
>
>