[英]Screen reader not reading list values while navigating with arrow keys
I have an input field where a typeahead popup comes on searching for something.我有一个输入字段,其中一个预先输入的弹出窗口会在搜索某些内容时出现。 The screen reader is unable to read the values of suggestions in the popup.
屏幕阅读器无法读取弹出窗口中的建议值。
I am maintaining the focus using $ActiveIndex
variable.我使用
$ActiveIndex
变量来保持焦点。 I am able to navigate the list using only the arrow keys , the screen reader just reads the input text when navigating the popup list and not the actual values in the suggestions我只能使用箭头键导航列表,屏幕阅读器在导航弹出列表时只读取输入文本,而不是建议中的实际值
The HTML code is something like this: HTML 代码是这样的:
<input type="text"
class="search"
title="Search User"
ng-model="vm.SearchText"
ng-model-options="{ debounce: 300 }"
aria-label="{{ placeholder }}"
ng-required="requiredattr" />
<ul class="ui list menu typeahead popup-layer vertical" ng-show="vm.MenuShown" ng-mousedown="vm.RetainFocus()">
<li class="item"
ng-class="{ active: $index == vm.ActiveIndex }"
ng-click="vm.Add(match)"
ng-repeat="match in vm.Matches track by $index">
<div class="header">
<i class="ban icon" ng-if="match.Deleted"></i>
<span ng-bind-html="match.DisplayName"></span> <!-- I want this DisplayName to be read -->
</div>
</li>
</ul>
The UI looks like this用户界面看起来像这样
The screen reader is just reading "suh" everytime I navigate the results with arrow keys.每次我用箭头键浏览结果时,屏幕阅读器都会读取“suh”。
Things I have tried:我尝试过的事情:
You can use aria-active-descendant attribute and set it to the list options ids and also use aria-owns property from the input box to refer the list items.您可以使用 aria-active-descendant 属性并将其设置为列表选项 ID,还可以使用输入框中的 aria-owns 属性来引用列表项。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.