简体   繁体   English

屏幕阅读器不阅读只有 1 个字符的标题

[英]Screen reader not reading headings with only 1 character

I am fairly new to working with accessibility and am encountering an issue with JAWS and Narrator screen readers wherein it couldn't read numbers/letters that consist of only 1 character.我对使用辅助功能相当陌生,并且遇到了 JAWS 和讲述人屏幕阅读器的问题,其中它无法读取仅包含 1 个字符的数字/字母。

Below is a sample code snippet of what I'm trying to resolve wherein Notes is being read but 1 is not.下面是我正在尝试解决的示例代码片段,其中正在读取Notes但未读取1

<div class="box">
    <h2 class="name" aria-label="Notes">Notes</h2>
    <h1 class="description" aria-label="1">1</h1>
</div>

When I try to do traverse through it per character, 1 is being read as blank .当我尝试按字符遍历它时, 1被读取为空白

There are 2 things I noticed:我注意到了两件事:

  • this behavior would only happen on 1 character and JAWS would read be able to read it if the number/character becomes at least 2 digits.这种行为只会发生在 1 个字符上,如果数字/字符变为至少 2 位数字,JAWS 将能够读取它。
  • NVDA does not have an issue with this and is able to read it properly. NVDA 对此没有问题,并且能够正确读取它。

A big piece missing from your question is how you are navigating with the screen reader.您的问题中缺少的一个重要部分是您如何使用屏幕阅读器进行导航。

There are many ways to navigate a webpage using a screen reader.使用屏幕阅读器浏览网页的方法有很多种。 For JAWS and NVDA (which have similar shortcut keys), you can use:对于 JAWS 和 NVDA(具有相似的快捷键),您可以使用:

  • up/down arrow to go to the prev/next DOM element (it's really the next element in the accessibility tree but for now just think of it as a way to navigate the DOM).向上/向下箭头转到上一个/下一个 DOM 元素(它实际上是可访问性树中的下一个元素,但现在只是将其视为导航 DOM 的一种方式)。 This is how a user can access every piece of text on the page.这就是用户可以访问页面上每一段文本的方式。
  • left/right arrow key to go to the prev/next character, one at a time左/右箭头键转到上一个/下一个字符,一次一个
  • H to navigate to the next heading (and Shift + H to navigate headings backwards) H导航到下一个标题(和Shift + H向后导航标题)
  • 1 , 2 , 3 to navigate to the next H1, H2, H3, etc (and Shift versions to go backwards) 1 , 2 , 3导航到下一个 H1、H2、H3 等(和Shift版本向后退)
  • Ins + F6 to see a list of headings and optionally to navigate to one of them. Ins + F6查看标题列表并可选择导航到其中一个。

I used all these ways to navigate your example and every time I heard "1" for the heading.我使用所有这些方法来浏览您的示例,并且每次我听到标题为“1”

Now, one thing that might make it sound like the letter is not being read is with NVDA, but you said the problem was with JAWS and Narrator.现在,可能听起来这封信没有被阅读的一件事是 NVDA,但你说问题出在 JAWS 和讲述人身上。 With NVDA, if I use the right arrow to navigate one character at a time, NVDA will announce the type of element it is before saying the one letter, so if you're not listening carefully, you might not hear the letter.使用 NVDA,如果我一次使用右箭头导航一个字符,NVDA 会在说出一个字母之前宣布它的元素类型,所以如果你不仔细听,你可能听不到字母。

Here's what NVDA says as I use the right arrow:当我使用右箭头时,这是 NVDA 所说的:

  • "heading level 2, N" “标题级别 2,N”
  • "o" “哦”
  • "t" “t”
  • "e" “e”
  • "s" “s”
  • "out of heading, heading level 1, 1 " “超出标题,标题级别 1, 1

Notice at the end NVDA told me I left the heading ("out of heading") as I right arrowed out of the "Notes" heading but in the same breath told me I entered a new heading ("heading level 1") and that it's a "level 1" heading and has the character "1".注意最后 NVDA 告诉我我离开了标题(“不在标题”),因为我向右箭头离开了“注释”标题,但同时告诉我我输入了一个新标题(“标题级别 1”)并且这是一个“1 级”标题,并且有字符“1”。 If you're not listening closely, you might not hear the final "1".如果你不仔细听,你可能听不到最后的“1”。

JAWS does not tell me the element type ("heading") as I right arrow. JAWS 没有告诉我向右箭头的元素类型(“标题”)。 It only says the character:它只说角色:

  • "N" “N”
  • "o" “哦”
  • "t" “t”
  • "e" “e”
  • "s" “s”
  • "1" “1”

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

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