I am using JAWS v2023.2212.23
I have a div container inside that we have paragraph and lists. My requirement is that when I focus on my div container jaws should read the entire block.
我使用的是JAWS v2023.2212.23,我有一个div容器,里面有段落和列表。我的要求是,当我专注于div容器时,JAWS应该读取整个块。
With presentation role it will read only the first paragraph.
对于演示角色,它将只读第一段。
<div tabindex="0">
<p>one</p>
<p>four</p></div>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
<p> </p>
<p>five</p></div>
Can someone help me to understand what all aria attribute is required so jaws will read the entire content.
谁能帮我理解所有咏叹调属性是必需的,以便JAWS将阅读整个内容。
I tried adding role as presentaion. My requirement is JAWS should read the entire content
我试着加了个角色来做主持人。我的要求是JAWS应该阅读整个内容
更多回答
Why do you set tabindex=0 and role=textbox? It only make sense if your div indeed represents an editable text area (in which case you should also set the contenteditable attribute). Otherwise, for normal non-editable text, you should remove both attributes. Using role=presentation doesn't make sense either, as it basically disables the original role of elements.
为什么设置tabindex=0和Role=TextBox?只有当您的div确实表示一个可编辑的文本区域时才有意义(在这种情况下,您还应该设置Content edable属性)。否则,对于普通的不可编辑文本,您应该删除这两个属性。使用Role=Presentation也没有意义,因为它基本上禁用了元素的原始角色。
Thanks, @QuentinC for your response. With role=presentation JAWS reads only the first paragraph '<p>one</p>' and then we need to press the down key to traverse it further. As per our requirement when the container div has the focus it should read the entire block (including paragraph and list) Could you please suggest how to achieve it
感谢@QuentinC的回复。使用ROLE=Presentation时,JAWS只读取第一段‘one
’,然后我们需要按下向下键以进一步遍历它。根据我们的要求,当容器div有焦点时,它应该阅读整个块(包括段落和列表),请您建议如何实现它
You still didn't clearly said what you intent to do as asked by @Slugolicious. If your div is a text box where the user can modify the text inside it, then role=textbox is suitable and the element must more or less follow the same requirements as native form fields (i.e. having a label). Otherwise if it's just regular text, your div shouldn't be focusable and no role is needed (please remove both role and tabindex attributes, as they are incorrect in this case)
你仍然没有按照@斯拉戈卢斯的要求清楚地说出你打算做什么。如果您的div是一个文本框,用户可以在其中修改其中的文本,则Role=TextBox是合适的,并且元素必须或多或少遵循与本机表单域相同的要求(即具有标签)。否则,如果它只是普通文本,您的div不应该是可聚焦的,并且不需要角色(请删除角色和tabindex属性,因为在这种情况下它们是不正确的)
优秀答案推荐
Your code example is a little confusing. Your <div> only contains two paragraphs and then closes. The list is outside the <div>. Did your example accidentally close the <div> too soon? You have a second closing <\div> so I'm guessing the first closing <\div> is a mistake?
您的代码示例有点令人困惑。您的
只包含两个段落,然后结束。该列表在
之外。您的示例是否意外地过早关闭了
?您有第二个结束语<\div>,所以我猜第一个结束语<\div>是错误的?
<div tabindex="0">
<p>one</p>
<p>four</p>
</div>
<ul>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
<p> </p>
<p>five</p>
</div>
I also don't see role="textbox"
or aria-readonly="true"
in your code example.
在您的代码示例中,我也没有看到Role=“Textbox”或aria-readonly=“true”。
It's not quite clear what you want to do. When you say "focus on my div container", do you literally mean the keyboard focus, such as the tab key? Because you can "focus" lots of different ways using a screen reader. I can use the up or down arrow key to walk the DOM and "focus" on the <div> that way.
现在还不太清楚你想做什么。当您说“专注于我的div容器”时,您的字面意思是指键盘焦点,例如Tab键吗?因为您可以使用屏幕阅读器以许多不同的方式“聚焦”。我可以使用向上或向下箭头键遍历DOM并以这种方式“聚焦”
If the <div> had a role
, such as "textbox", then I could use a single letter navigation key to "focus" on the <div>. JAWS uses E to move to the next textbox, or F to the next form element.
如果
有一个角色,比如“TextBox”,那么我可以使用一个字母导航键来“聚焦”
。JAWS使用E移动到下一个文本框,或使用F移动到下一个表单元素。
Also note that when an accessible name is computed for an element, all the nested structural semantics are stripped away and only the text is kept. So if you had an embedded list and wanted that as part of the accessible name, only the text of the list would be kept and the user wouldn't know there's an embedded list.
还要注意,当计算元素的可访问名称时,所有嵌套的结构语义都会被剥离,只保留文本。因此,如果您有一个嵌入的列表,并希望将其作为可访问名称的一部分,则只保留列表的文本,而用户不会知道有嵌入的列表。
And getting back to screen reader navigation and "focus", if you have a list, the screen reader user can navigate to the list using L or to individual list items using i.
返回到屏幕阅读器导航和“焦点”,如果您有一个列表,屏幕阅读器用户可以使用L导航到列表或使用i导航到单个列表项。
I think more detail is needed in your question, and perhaps a working example, to fully explain what you're trying to do.
我认为你的问题需要更多的细节,也许是一个工作的例子,以充分解释你想做什么。
更多回答
Thanks for your response. Please find my response on your queries. Yes, by mistake I closed the div after the paragraph. It has to close at the end of the block. Focus on my div container - Yes I am referring here to tab focus. My requirement is jaws should read the entire content when div is focused (paragraph and list) Right now it is only reading the paragraph and not reading the list. With this structure - Jaws read paragraph one and two and stop after it Could you please suggest an appropriate role for the div so Jaws can read the entire content?
感谢您的回复。请查看我对您的问题的回复。是的,我错把div放在段落后面了。它必须在街区的尽头关闭。焦点放在我的div容器上--是的,我指的是标签焦点。我的要求是,当div被聚焦(段落和列表)时,JAWS应该阅读整个内容,它现在只阅读段落,而不是列表。使用这种结构-Jaws阅读第一段和第二段,然后停下来。您能为div建议一个合适的角色,以便Jaws可以阅读整个内容吗?
It’s not clear what the purpose of the <div> is so I can’t recommend a role yet.
目前还不清楚这是什么目的,所以我还不能推荐一个角色。
我是一名优秀的程序员,十分优秀!