我使用的是 Angular,每次当下面代码中的 isVisible
变为 true 时,下面的 html 代码就会呈现在页面上。
<div *ngIf="isVisible"> <span aria-live="assertive" aria-atomic="true">Read this new text</span> </div>
每次渲染时(可以根据行为删除和添加多次),我需要 JAWS 来发音跨度中的文本:阅读这个新文本
。
为此,我尝试使用 aria-live="polite" (不发音),甚至 aria-live="assertive" 甚至 aria-live="assertive" 和 aria-atomic="true" 基于此 Aria -在 chrome 问题上删除元素时,实时区域不会读出更新。
如何让它发挥作用? 使用:JAWS、Google Chrome。
P粉0374504672024-02-04 09:16:24
添加或删除活动区域效果不佳,您应该仅操作此类区域的内容。
Read this new text
assertive
是否是正确的选择应该非常仔细地考虑。这对用户来说是相当具有破坏性的。大多数时候 polite
是更好的选择。
另一个一般建议是,所发布的信息也需要能够根据用户的条件轻松访问,以防用户错过或不理解。字段的错误消息应通过警报宣布,但也应绑定到输入字段,以便每次用户聚焦该字段时读取。