0

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.

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>&nbsp;</p>
<p>five</p></div>

Can someone help me to understand what all aria attribute is required so jaws will read the entire content.

I tried adding role as presentaion. My requirement is JAWS should read the entire content

3
  • 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.
    – QuentinC
    Commented Sep 8, 2023 at 17:38
  • 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 Commented Sep 11, 2023 at 17:35
  • 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)
    – QuentinC
    Commented Sep 17, 2023 at 5:20

1 Answer 1

0

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 tabindex="0">
  <p>one</p>
  <p>four</p>
</div>
<ul>
  <li>one</li>
  <li>two</li>
  <li>three</li>
</ul>
<p>&nbsp;</p>
<p>five</p>
</div>

I also don't see role="textbox" or aria-readonly="true" in your code example.

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.

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.

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.

I think more detail is needed in your question, and perhaps a working example, to fully explain what you're trying to do.

2
  • 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? Commented Sep 11, 2023 at 14:17
  • It’s not clear what the purpose of the <div> is so I can’t recommend a role yet. Commented Sep 11, 2023 at 18:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.