[英]Screen reader and HTML document focus
I'm new to this whole ARIA and accessibility aspect of HTML. 我是HTML的整个ARIA和可访问性方面的新手。 I have an app where most of the things work properly with screen readers.
我有一个应用程序,其中大部分内容均可与屏幕阅读器一起正常使用。 However, when I click away from any control, ie focus on the document, NVDA always reads " page title document".
但是,当我单击任何控件时(即将焦点放在文档上),NVDA始终读取“ 页面标题文档”。 I've been trying to stop it from doing that for a while but unsuccessfully.
我一直试图阻止它这样做一段时间,但未成功。
The best thing I came up with is to add tabindex=0
to my topmost DIV
so that it would receive focus on click instead of document, but even then NVDA reads the word "section" when it gets focused. 我想到的最好的办法是将
tabindex=0
添加到最上面的DIV
以便它将焦点集中在单击而不是文档上,但是即使这样NVDA也会在焦点对准时读取“节”一词。 Is there a way to suppress this? 有没有办法抑制这种情况?
I also tried removing title and adding it back in in a short timeout and then reader says just the word "document" which is fine, but depending on JS activity timeout sometimes flickers empty title as it is executed not that consistently. 我也尝试过删除标题,并在短时间内将其添加回去,然后读者说“ document”一词很好,但是取决于JS活动超时,有时会闪烁空标题,因为执行的不一致。 And requestAnimationFrame is too short, reader doesn't have time to pick the empty title and reads it anyway.
而且requestAnimationFrame太短,读者没有时间选择空标题,反正也可以读取它。
When you click on the document body, it will become focused and the previously focused control will blur. 当您单击文档主体时,它将变为聚焦状态,并且先前聚焦的控件将模糊。 Screen reader will reflect this change by reading the accessible name of the newly focused widget, namely the document title.
屏幕阅读器将通过阅读新聚焦的窗口小部件的可访问名称(即文档标题)来反映此更改。 This is perfectly normal and entirely expected behavior, there is no need to change that.
这是完全正常的行为,完全是预期的行为,无需更改。
You need to keep in mind that your expectations as a sighted developer are entirely not the same as any user, much less visually impaired user. 您需要牢记,作为有远见的开发人员,您的期望与任何用户都不相同,而视障用户则要少得多。 What seems natural and expected to you will be highly confusing to a blind person.
盲人会感到很自然,而且对您期望很高。
Try being in their place for a while. 尝试在自己的位置呆一会儿。 Put a sleep mask over your eyes and try using your app relying only on keyboard and screen reader.
戴上睡眠面膜,然后尝试仅依靠键盘和屏幕阅读器使用您的应用程序。 I do that often, and it's a very enlightening experience.
我经常这样做,这是非常令人启发的经历。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.