简体   繁体   English

当 matDialog 弹出窗口时,它会添加 aria-hidden 到<app-root>元素</app-root>

[英]When matDialog pop'ups, it adds aria-hidden to <app-root> element

When scanning page with ARC Toolkit (Accessibility testing plugin), if modal is opened, scanner shows error, because there is aria-hidden on parent () of one or more focusable child elements.当使用 ARC 工具包(辅助功能测试插件)扫描页面时,如果模式打开,扫描器会显示错误,因为在一个或多个可聚焦子元素的父级()上存在 aria-hidden。

I have removed aria-hidden with jQuery, but is there any way, to prevent adding aria-hidden on app root by default in Angular?我已经用 jQuery 删除了 aria-hidden,但是有什么办法可以防止在 Angular 中默认在应用根目录上添加 aria-hidden?

Hiding all other contents while a modal dialog is open from assistive technology (AT) is standard procedure.在通过辅助技术 (AT) 打开模态对话框时隐藏所有其他内容是标准程序。

Since AT provides a bunch of techniques to navigate a web page, not only focus needs to be restricted to the dialog, but any access to the underlying content.由于 AT 提供了一系列技术来导航 web 页面,因此不仅焦点需要限制在对话框上,而且对底层内容的任何访问都需要限制。

Since ARIA 1.1, the aria-modal attribute should be set on the dialog, which should render all other contents inert.自 ARIA 1.1 起,应在对话框上设置aria-modal属性,这应使所有其他内容呈现惰性。 This does not work everywhere, yet.这并不适用于所有地方,然而。

So as the APG mention on inert :因此,正如APG 在 inert 上提到的那样:

However, in legacy dialog implementations where aria-hidden is used to make content outside a dialog inert for assistive technology users, it is important that:但是,在aria-hidden用于使对话外部的内容对辅助技术用户惰性的遗留对话实现中,重要的是:

  • aria-hidden is set to true on each element containing a portion of the inert layer. aria-hidden在每个包含惰性层一部分的元素上设置为 true。
  • The dialog element is not a descendant of any element that has aria-hidden set to true. dialog 元素不是任何将aria-hidden设置为 true 的元素的后代。

To avoid the latter case, usually, dialogs are put outside the app-root via portals or similar, so that the app-root can be hidden.为了避免后一种情况,通常通过门户或类似方式将对话框放在应用程序根目录之外,以便隐藏应用程序根目录。

If I inspect the Angular Material dialog example , the cdk-overlay-container , which contains the dialog, is well placed along with material-docs-app , which is the app-root.如果我检查Angular Material dialog example ,包含对话框的cdk-overlay-containermaterial-docs-app一起放置得很好,这是 app-root。

The warning can be discarded, as this github issue also supports可以丢弃警告,因为这个 github 问题也支持

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

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