嗨,我正在研究 Angular,我们需要弹出可访问性。 我从此链接中引用了这一点:
https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html
它指出使用 aria-modal="true"将不允许屏幕阅读器读取后台内容,但它在 JAWS 18 版本中不起作用,在 JAWS 19 版本中不起作用。
这就是我的代码的样子:
我有一个dialog.component.html
<div aria-modal="true">
model-contet goes here
</div>
现在我正在注入(inject)这个组件<dialog></dialog>
各种组件内部。但它仍然继续读取下面的内容。
最佳答案
您的代码是正确的,但 aria-modal
尚未得到很好的支持。
目前,您必须对不属于对话框的元素设置aria-hidden
。如果您的代码/DOM 可以安排为使对话框成为主窗口的同级,则可以更轻松地设置 aria-hidden。
请参阅我在 focus moving out of modal in scan mode 上的回答
关于javascript - JAWS 18 不支持 aria-modal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54288847/