NVDA在读取模态对话框中的焦点元素后读取所有模态内容 [英] NVDA reads all modal content after reading the focused element in modal dialog

查看:293
本文介绍了NVDA在读取模态对话框中的焦点元素后读取所有模态内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了对模式对话框中出现的第一个选项卡(基本上是< a> 元素)进行聚焦的要求。

I have implemented a requirement to focus the first tab(basically an <a> element) present inside the modal dialog.

使用NVDA屏幕阅读器测试功能时,可以看到在读取对话框标签和描述(由aria-labelledby和aria-describeby指向)后,它会读取聚焦的标签元素。但是,此后,它将继续从模态标题开始读取整个模态对话框的内容。这不是我们想要的阅读行为。

When using NVDA screen reader to test the feature, it is observed that after reading dialog label and description (pointed by aria-labelledby and aria-describedby) it reads the focused tab element. However, after that it continues on to read the entire modal dialog content starting with modal heading. This is not the desired reading behavior we want.

如果我们将焦点放在模式对话框中的第一个输入元素上,而不是制表符( < a> )元素,效果很好。读取聚焦的输入元素后,NVDA暂停。仅当我们使用Tab键导航时,其他元素才会被读出。这是我们想要的理想阅读行为,但我们不想集中输入元素。

If we put focus on the first input element inside the modal dialog, instead of the tab(<a>) element, it works fine. NVDA pauses after reading the focused input element. Further elements are read out only when we navigate using tab key. This is the desired reading behavior we want, but we don't want to focus the input element.

演示链接可在此处找到: https://codepen.io/kaashan/pen/KOmGYe

使用的代码来自
W3.org模态对话框的辅助功能指南,进行了少量修改,以显示选项卡并将第一个选项卡元素集中在模态打开上。

Demo link can be found here : https://codepen.io/kaashan/pen/KOmGYe . The code used is from W3.org accessibility guidelines for modal dialogs with minor modifications to display tabs and focus the first tab element on modal open.

我正在使用NVDA2019 .1.1版本,其中包含适用于我的测试的最新版本的Chrome和Firefox浏览器。

I am using NVDA2019.1.1 version with latest version of Chrome and Firefox browser for my tests.

有人可以帮忙解释一下在读取NVDA焦点选项卡后应该如何暂停NVDA。 (< a> )元素?

Could someone help to explain what should be done to pause the NVDA after it has read the focused tab(<a>) element?

推荐答案

您误解了如何使用了NVDA。

You have misunderstood how NVDA is used.

您尝试停止的行为是INTENDED行为,它允许用户查看表单包含的内容并了解他们将要做什么。

The behaviour you have tried to stop is the INTENDED behaviour and allows a user to see what a form contains and get an understanding of what they are about to fill out.

不要尝试让NVDA按照您希望的方式工作。

Do not try and get NVDA to work how you want it to work.

只需遵循最佳做法(如您所做的),并让用户担心y要读者发挥作用。

Just follow best practices (as you have done) and let the user worry about how they want the reader to function.

很难完全脱离上下文测试某些东西,但是在给出的示例中,您似乎处在正确的轨道上。

It is hard to fully test something out of context but within the example you have given you seem to be on the right track.

要检查的两件事(在您正在使用的文档中)

Two things to check (within the document you are using this within)


  1. 情态不会读取选项卡2后面隐藏的内容,并且在打开时不会读取任何其他页面内容,它应该在读取了整个情态内容之后停止。

  2. 您可以使用Escape键关闭模式。 。

希望这会有所帮助。

这篇关于NVDA在读取模态对话框中的焦点元素后读取所有模态内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆