I am trying to add live region support in a web page to make NVDA usable with the page. However, I have seen quite a different behavior with aria-live
attributes than expected.
I have tried adding a single live region which is hidden and I dump all the messages (each message enclosed in
<p>
tag) into that region to be read by screen reader. It works fine, but the only problem is that the first message inserted into live region div is never read by the NVDA screen reader. Subsequent messages are read perfectly. This live regions div is created dynamically when the first message is to be announced.aria-live="assertive"
doesn't really interrupt the current flow to announce the message.I am using knockout in web page. When HTML div, which is marked as live-region, is displayed based on knockout condition, then it is not detected by screen reader. For example:
<!-- ko if: $data --> <div aria-live="polite" data-bind="text: $data"> </div> <!-- ko -->
When page is loaded initially, $data is null. So live-region div is absent. But when data is fetched that div gets inserted. However, NVDA doesn't read the content in added div. Is this expected behavior? Is there any workaround to fix this behavior?