简体   繁体   中英

aria-live on textarea not working with JAWS

I am using html textarea to simulate a command prompt. On typing a command command (eg ipconfig) and hitting Enter key, the command output gets appended to to the text. To read the output I have added aria-live="polite" attribute to the textarea which works fine with NVDA screen reader. However, JAWS on IE, starts reading from the top every time a command is entered. How do I make it read only the newly appended text like NVDA does?

So far I have tried aria-relevant="additions", role=log, role=alert attributes but nothing seems to work.

enter code here
<textarea id="commandPrompt" aria-live="polite"
     rows="5" cols="45" wrap="off" spellcheck="false">
</textarea>

IN theory, you should be able to define precisely what should be read using aria-relevant and aria-atomic. Unfortunately, Jaws doesn't follow standards very well. These two attributes are known not to always work as expected with Jaws, depending on the browser used, the element to which they are applied, etc.

This is probably not the answer you wanted to have, but if Jaws doesn't do what you expect, the only solution is most likely to put the text to be spoken in another element. In a div or span you are much more mikely to have the expected behavior.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM