简体   繁体   English

NVDA无法读取Microsoft Edge中具有“对话框”角色的div上的aria标签

[英]NVDA not reading aria-label on a div with role “dialog” in Microsoft Edge

In our website, there's a div element that has the role of "dialog" and an aria-label attribute. 在我们的网站中,有一个div元素,具有“ dialog”(对话)和aria-label属性的作用。

It works just fine for the following combinations: 它适用于以下组合:

Voice Over + Google Chrome / Mozilla Firefox / Safari 旁白+ Google Chrome / Mozilla Firefox / Safari
NVDA + Google Chrome / Mozilla Firefox / Internet Explorer NVDA + Google Chrome / Mozilla Firefox / Internet Explorer

However, it is completely ignored when we use: 但是,当我们使用以下命令时,它将被完全忽略:

NVDA + Microsoft Edge(*) NVDA + Microsoft Edge(*)

(*) It actually works on an older version of Edge (38), but it doesn't work for the latest: 42. (*)实际上可以在旧版本的Edge(38)上使用,但不适用于最新版本:42。

This is the element: 这是元素:

<div role="dialog" aria-label="name">
 <a title="Hide Dialog" href="#" id="eg"></a> 
</div>

In all successful cases (eg: NVDA + Chrome), it reads "name dialog" , then "hide dialog link" . 在所有成功的情况下(例如:NVDA + Chrome),它将读取"name dialog" ,然后显示"hide dialog link"

In NVDA + Edge (42) it goes: 在NVDA + Edge(42)中:

"Hide dialog link, hide dialog" . "Hide dialog link, hide dialog"

In NVDA + Edge (38) it goes: "Clickable link hide dialog" then "name dialog" 在NVDA + Edge(38)中: "Clickable link hide dialog"然后是"name dialog"

Any ideas? 有任何想法吗?

Have you tested with JAWS? 您是否已通过JAWS测试过? Internet Explorer has some trouble with role="dialog" as explained in Scott O'Hara's blog on The Paciello Group website. 正如Paciello Group网站上的Scott O'Hara的博客中所述 ,Internet Explorer在Role role="dialog"存在一些麻烦。 Read the whole thing but in particular, look for the section called "IE11 needs the first element of the modal dialog to be its heading". 阅读全部内容,但尤其要查找名为“ IE11的部分,该标题为模式对话框的第一个元素”。

IE11 needs the first element of the modal dialog to be its heading IE11需要模式对话框的第一个元素作为其标题

The first element of a modal dialog should be its heading (which provides its accessible name). 模态对话框的第一个元素应该是其标题(提供其可访问的名称)。 This requirement is to compensate for Internet Explorer 11 + JAWS specifically. 此要求是为了专门补偿Internet Explorer 11 + JAWS。 With this pairing, setting focus to the dialog element itself will announce the accessible name of the dialog, the dialog role, and then JAWS will re-announce the accessible name of the dialog, and the role of the first child element of the dialog. 通过这种配对,将焦点设置到对话框元素本身将宣布对话框的可访问名称,对话框角色,然后JAWS将重新宣布对话框的可访问名称以及对话框的第一个子元素的角色。

For instance, if the dialog's heading provides the accessible name for the dialog, then JAWS + IE11 will announce “heading text, dialog. 例如,如果对话框的标题提供了该对话框的可访问名称,则JAWS + IE11将宣布“标题文本,对话框”。 heading text, heading level #”. 标题文字,标题级别为“”。 However, if the first child is another element that does not match the accessible name of the dialog, such as a button with text “close”, it will be announced as: “heading text, dialog. 但是,如果第一个子元素是与对话框的可访问名称不匹配的另一个元素,例如带有“关闭”文本的按钮,则它将宣布为:“标题文本,对话框”。 heading text, button” 标题文字,按钮”

Now, you're asking about Edge and not IE, but you didn't say anything about testing with JAWS either. 现在,您在问的是Edge而不是IE,但您也没有说有关使用JAWS进行测试。 It could be that NVDA on Edge might have the same problem as JAWS on IE, but that's just a stab in the dark for you to check into. Edge上的NVDA 可能与IE上的JAWS存在相同的问题,但这只是暗中的检查。 The way you describe the problem, it sounds like the same problem as IE and it's something you have to code around (that is, it's a bug in IE and/or Edge, and not a bug in your code, but you still have to code around it if you want it to work). 描述问题的方式,听起来和IE一样,都是必须解决的问题(也就是说,这是IE和/或Edge中的错误,而不是代码中的错误,但是您仍然必须代码(如果您希望它可以正常工作)。

NVDA is more compatible with Firefox, Jaws is more compatible with Internet Explorer and Edge. NVDA与Firefox更加兼容,Jaws与Internet Explorer和Edge更加兼容。

Narrator is More compatible with Edge. 讲述人与Edge更加兼容。

In general if you are using anchor tag then you have to provide some text inside the anchor. 通常,如果您使用锚标记,则必须在锚内提供一些文本。 Also it is not a good practice to use empty anchor tags. 同样,使用空锚标签也不是一个好习惯。

If we use basic html semantic standards then it will work fine. 如果我们使用基本的html语义标准,那么它将正常工作。

Also if we are using role="dialog" we will send the focus to the container of the dialog, will use aria-labelled-by to relate with the dialog heading. 同样,如果我们使用role =“ dialog”,我们会将焦点发送到对话框的容器,并将使用aria-labeled-by与对话框标题相关。

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

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