简体   繁体   English

焦点不会在浏览模式 nvda 中列出项目

[英]focus not going to listitems in browse mode nvda

similar thing happening here with this code.这段代码在这里发生了类似的事情。 Browse mode focus not going to list items.浏览模式焦点不会列出项目。

 {<ul style="
        margin: 0px;
        padding: 0px;
    "><li class="attachmentsContainerStyle-319" style="
        text-align: unset;
    " role="listitem" aria-setsize="2" aria-posinset="1">Screenshot 2023-01-09 at 4.34.36 PM_2023-01-12T17:10:00.6072590Z.png</li><li class="attachmentsContainerStyle-319" role="listitem" aria-setsize="2" aria-posinset="2"><p class="attachmentStyle-320"><i data-icon-name="TextDocument" aria-hidden="true" class="attachmentIconStyle-365"></i> Screenshot 2023-01-09 at 4.34.36 PM_2023-01-12T17:10:47.4149896Z.png</p><div><button type="button" class="ms-Link jaIaction-366" aria-disabled="false"><i data-icon-name="Download" aria-hidden="true" class="jaIactioIcon-367"></i>Download</button><button type="button" class="ms-Link jaIaction2-368" aria-disabled="false"><i data-icon-name="Delete" aria-hidden="true" class="jaIactioIcon-367"></i>Delete</button></div></li></ul>}

I want the screenreader to read list item 1 of 2 but the focus directly going to the document name in the list item that is in <p> container.我希望屏幕阅读器阅读 2 中的列表项 1,但焦点直接转到 <p> 容器中列表项中的文档名称。

Your original question is about NVDA and browse mode but you tagged the question with android-a11y .您最初的问题是关于 NVDA 和浏览模式,但您用android-a11y标记了问题。 I'm going to ignore android for now.我现在要忽略 android。

With NVDA in browse mode, did you try navigating to your list using the L key or to each list item using the i key?在 NVDA 处于浏览模式时,您是否尝试过使用L键导航到列表或使用i键导航到每个列表项?

If your main concern is hearing "X of Y" as you navigate each list item, that's totally up to the screen reader itself in addition to user settings.如果您主要关心的是在浏览每个列表项时听到“X of Y”,那么除了用户设置之外,这完全取决于屏幕阅读器本身。 A user can change their verbosity settings and totally turn off the announcement for a list start/end as well as the position within the list, so there's no way you can force that announcement other than having literal "X of Y" text in your code (visibly hidden) for the screen reader to announce.用户可以更改他们的冗长设置并完全关闭列表开始/结束以及列表中的 position 的通知,因此除了在代码中使用文字“X of Y”文本之外,您无法强制执行该通知(明显隐藏)供屏幕阅读器宣布。

I noticed you had aria-postinset and aria-setsize in your sample code.我注意到您的示例代码中有aria-postinsetaria-setsize I'm assuming you were trying to force the "X of Y" announcement.我假设您试图强制发布“X of Y”公告。 Those attributes are not needed when you're using semantic <ul> or <ol> elements and, as you probably noticed with your testing, does not force the "X of Y" announcement.当您使用语义<ul><ol>元素时不需要这些属性,并且正如您在测试中可能注意到的那样,不会强制声明“X of Y”。 That again is up to the screen reader software and the user settings.这又取决于屏幕阅读器软件和用户设置。

Same with role="listitem" - it's not needed in your example.role="listitem"相同 - 在您的示例中不需要它。

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

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