提交 33ccb980 编写于 作者: I isidor

accessibility: list role for lists, listbox for suggestWidget

#92483
上级 5349bf1f
......@@ -65,7 +65,7 @@ export interface IIdentityProvider<T> {
export enum ListAriaRootRole {
/** default list structure role */
LIST = 'listbox',
LIST = 'list',
/** default tree structure role */
TREE = 'tree',
......
......@@ -604,6 +604,12 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
useShadows: false,
openController: { shouldOpen: () => false },
mouseSupport: false,
ariaRole: 'listbox',
ariaProvider: {
getRole: () => 'option',
getSetSize: (_: CompletionItem, _index: number, listLength: number) => listLength,
getPosInSet: (_: CompletionItem, index: number) => index,
},
accessibilityProvider: {
getAriaLabel: (item: CompletionItem) => {
const textLabel = typeof item.completion.label === 'string' ? item.completion.label : item.completion.label.name;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册