简体   繁体   English

在屏幕阅读器中移动光标

[英]Moving the cursor in a screen reader

Background 背景

I have a site which has a master/detail sort of design. 我有一个网站具有大师/详细的设计。 The master view is a column chart where clicking on one of the columns (each column represents one month) changes the detail view (which is a nested table listing some details of that period). 主视图是一个柱形图,单击其中一个列(每个列代表一个月)可以更改详细信息视图(这是一个嵌套表,列出了该期间的一些详细信息)。 I've started an accessibility audit and as you might imagine, it is not very accessible. 我已经开始了可访问性审核,并且您可能会想到,它不是很容易访问。 I solved the chart by adding aria-hidden="true" and adding an invisible table with the same content with buttons in the month rows. 我通过添加aria-hidden="true"并添加一个不可见的表格来解决该图表,该表格的内容与月份行中的按钮相同。 Now activating the buttons will do the same thing as clicking the chart columns - change the detail view. 现在激活按钮将与单击图表列执行相同的操作-更改详细视图。

Moving focus 移动焦点

When the button in a table in the master view is clicked, my screen reader (VoiceOver Safari in this case) reads "Button clicked", but then using the cursor keys keeps reading the table. 单击主视图中表格中的按钮时,我的屏幕阅读器(在本例中为VoiceOver Safari)读取“单击按钮”,但随后使用光标键继续读取表格。 I assume a user once they decide which button to click would like to read the detail view and so I would like to move them there. 我假设用户一旦确定要单击哪个按钮就想阅读详细视图,因此我想将其移到那里。

What I have tried 我尝试过的

I changed the buttons to <a href="#detail-view" ng-click="loadDetail"> and gave the detail view container div the id="detail-view" . 我将按钮更改为<a href="#detail-view" ng-click="loadDetail"> ,并为详细信息视图容器div赋予了id="detail-view" This doesn't seem to do anything. 这似乎无能为力。

Simple answer: don't. 简单的答案:不要。 Shifting focus around on a non-sighted user is actually an accessibility violation. 实际上,将注意力转移到没有视力的用户上实际上是对可访问性的侵犯。 See WCAG criteria 3.2.2. 参见WCAG标准3.2.2。

In short, you shouldn't initiate a change of context automatically after the press of a button or other control interaction. 简而言之,您不应在按下按钮或其他控件交互之后自动启动上下文更改。 What you should do is inform the user of the new content, either by an announcement, or by providing a description of the change in the accessibility text of the control itself. 您应该做的是通过公告或通过提供控件本身的可访问性文本的更改描述来将新内容通知用户。 An example of providing this context would be announcing your master cells as "tabs". 提供此上下文的一个示例是将主单元格声明为“选项卡”。 Just the simple association of a button behaving as a tab provides a lot of information! 只是将按钮作为选项卡的简单关联即可提供很多信息!

To make your application more accessible you should ensure the user knows they are in a master-detail type of control, by providing proper role information (I find "tab" most likely here, but other roles may be applicable). 为了使您的应用程序更易于访问,您应该通过提供适当的角色信息(我在这里最有可能找到“选项卡”,但其他角色也可能适用)来确保用户知道他们处于主从类型的控件中。 Also, provide a heading at the top of the master view, and the detail view, so that they can easily navigate between the two. 另外,在主视图和局部视图的顶部提供一个标题,以便他们可以轻松地在两者之间导航。 As long as they know where they are, and can easily navigate to important areas of the page, they are fine. 只要他们知道自己在哪里,并且可以轻松导航到页面的重要区域,就可以了。 Automatically shifting focus around is actually an accessibility violation, and should be avoided. 自动转移焦点实际上是对可访问性的侵犯,应该避免。

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

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