带有NVDA标签索引的Aria,Dialog和Div

时间:2021-08-20 20:24:40

I am trying to figure out why NVDA isnt speaking the inner HTML of a div that has a tabindex. The snipped below is inside a jquery-ui-dialog with an aria role of dialog. If I remove the aria-label, and I tab to this section NVDA just says "section". If I leave the aria-label, it speaks it. Is there a way to have it say the inner HTML without duplicating the text everywhere?

我试图弄清楚为什么NVDA不会说具有tabindex的div的内部HTML。下面的剪辑是在jquery-ui对话框内部,具有对话框的咏叹调角色。如果我删除了咏叹调标签,并且我在此部分中选择了NVDA,只是说“部分”。如果我留下咏叹调标签,就会说出来。有没有办法让它说内部HTML而不是到处复制文本?

 <div class="current-chapter" tabindex="0" aria-label="Chapter 1 of 10">
                Chapter 1 of 10
            </div>

1 个解决方案

#1


0  

aria-describedby can be used for this, e.g.:

咏叹调描述可以用于此,例如:

<div role="dialog" aria-describedby="dialogBody">
    <div id="dialogBody">
         Chapter 1 of 10
    </div>
</div>

May be span with the id would work too.

可能会延伸id也会起作用。

#1


0  

aria-describedby can be used for this, e.g.:

咏叹调描述可以用于此,例如:

<div role="dialog" aria-describedby="dialogBody">
    <div id="dialogBody">
         Chapter 1 of 10
    </div>
</div>

May be span with the id would work too.

可能会延伸id也会起作用。