FreedomScientific / standards-support

Contains documentation for Vispero software support of Web standards
https://freedomscientific.github.io/standards-support/
GNU General Public License v3.0
111 stars 12 forks source link

Live region with assertive value doesn't interrupt current narration #721

Closed kolaps33 closed 1 year ago

kolaps33 commented 1 year ago

Example to run (extract it to find html file): live-region-assertive.zip

Repro steps

  1. Set focus on "first" button
  2. Press TAB key
  3. Observe narration

Expected result

When live regions are marked as assertive, assistive technologies SHOULD notify the user immediately. In our example screen reader should interrupt focused button narration and should narrate live region content.

Actual result

screen reader finish narration of focused button. After that narrates live region content.

Example

please find enclosed HTML page

Additional Information

When user focus button, then there is timeout 10 milliseconds to trigger live region update.

JAWS version and build number

2023.2303.14

Operating System and version

Win11 Version 10.0.22621 Build 22621

Browser and version:

Chrome Version 113.0.5672.127 (Official Build) (64-bit)

Example source code:

<script>
  function startNarration() {
    var date = new Date();
    var seconds = date.getSeconds();
    var minutes = date.getMinutes();    
    const ariaLivePoliteElement = document.getElementById("liveassertive");
    setTimeout(() => {
      ariaLivePoliteElement.innerText = `confirmation message which should be narrated ${minutes} ${seconds}`;
    },10 );
  }

</script>
<button>first</button>
<button onfocus="startNarration()">any long text for, or even longer as expected</button>

<div>
  Assertive region:
  <span id="liveassertive" aria-atomic="true" aria-live="assertive" aria-relevant="all"></span>
</div>
stevefaulkner commented 1 year ago

@kolaps33 There are a couple of things going on here, but I think you need to use role="alert" if you want to interrupt the announcement of the button accessible name. Note i also change the display value of the message element. test case using role alert

assistive technologies SHOULD notify the user immediately. this is an normative RFC keyword:

SHOULD This word, or the adjective "RECOMMENDED", mean that there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course.

In this case AT decided that they don't want to interrupt the reading of the control name with aria-live=assertive.