html - Behavior of NVDA -
i trying add live region support in web page make nvda usable page. however, have seen quite different behavior aria-live
attributes expected.
i have tried adding single live region hidden , dump messages (each message enclosed in
<p>
tag) region read screen reader. works fine, problem first message inserted live region div never read nvda screen reader. subsequent messages read perfectly. live regions div created dynamically when first message announced.aria-live="assertive"
doesn't interrupt current flow announce message.i using knockout in web page. when html div, marked live-region, displayed based on knockout condition, not detected screen reader. example:
<!-- ko if: $data --> <div aria-live="polite" data-bind="text: $data"> </div> <!-- ko -->
when page loaded initially, $data null. live-region div absent. when data fetched div gets inserted. however, nvda doesn't read content in added div. expected behavior? there workaround fix behavior?
quick answer, pressed time.
you must have live region on page @ page render. primes browser monitor updates. adding element after fact primes browser, not trigger it.
i forked pen , got working in first button (through browser pronounces "xyz" "zeyes"). in debug mode there no codepen code in there @ (nor frames) jack up:
http://s.codepen.io/aardrian/debug/wgwqvm
non-debug mode cans see code:
http://codepen.io/aardrian/pen/wgwqvm
your code puts aria-live
on element wrapped within knockout ko if:
statement, not rendered page @ load:
<p>last name: <!-- ko if: lastname --> <strong aria-live="polite" data-bind="text: lastname"></strong> <!-- /ko --> </p>
i tweaked put live region around ko if:
check, , announced when button pressed:
<p>last name: <div aria-live="polite"> <!-- ko if: lastname --> <strong data-bind="text: lastname"></strong> <!-- /ko --> </div> </p>
yes, put <div>
in <p>
, demonstration purposes.
tested in nvda 2016.4 / firefox 50.1.1 , works believe intend. did not touch second 1 @ all.
Comments
Post a Comment