简体   繁体   English

JAWS仅在IE中读取“ aria-live”区域内的DOM节点的删除

[英]JAWS reads removal of DOM node within an `aria-live` region only in IE

The live region is: 实时区域为:

<div aria-live='assertive' id='abc'> </div>

In JavaScript, the first change I make is to 在JavaScript中,我要做的第一个更改是

document.getElementById("abc").innerHTML="<span>Processing</span>";

Next, I make another change: 接下来,我进行另一个更改:

document.getElementById("abc").innerHTML="<span>Done</span>";

JAWS has no problem in Firefox and reads both "Processing" and "Done". JAWS在Firefox中没有问题,并读取“处理中”和“完成”。 But IE reads "Processing Removing Processing Done" 但是IE会显示“正在处理正在删除正在处理”

I understand that I am replacing a <span> with a new <span> . 我明白,我更换<span>用新的<span> But how do I make JAWS ignore giving that update of removal? 但是,如何使JAWS忽略提供删除的更新?

我成功克服了IE中的这个错误的唯一方法是隐藏要删除的元素,添加新元素,然后再删除隐藏的元素。

To understand this bug in IE, you have to look to the documentation for the aria-relevant attribute which specify which changes you want the screenreader to be notified. 要了解IE中的这个错误,您必须查看aria-relevant属性的文档,该文档指定了要通知屏幕阅读器的更改。

See the following page in the Microsoft documentation: aria-relevant attribute 请参阅Microsoft文档中的以下页面: aria-relevant属性

In your case, IE considers (falsely) that you are doing a text update (because of the use of innerHTML which is considered as a string), so it notifies deletion and addition: 在您的情况下,IE会(错误地)认为您正在执行文本更新(因为使用了被视为字符串的innerHTML ),因此它会通知删除和添加:

Updates are announced only as nodes are added, or as text is added or removed . 仅在添加节点或添加或删除文本时宣布更新。

The solution should be to add or remove with the use of addChild() and removeChild() functions. 解决方案应该是使用addChild()removeChild()函数添加或删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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