提交 dfc46d75 编写于 作者: I Isidor Nikolic 提交者: GitHub

Merge pull request #29019 from Microsoft/isidorn/list-aria-size

List: set aria-setsize and aria-posinset
......@@ -651,12 +651,14 @@ export class List<T> implements ISpliceable<T>, IDisposable {
if (options.ariaLabel) {
this.view.domNode.setAttribute('aria-label', options.ariaLabel);
}
this.view.domNode.setAttribute('aria-setsize', '0');
this.style(options);
}
splice(start: number, deleteCount: number, elements: T[] = []): void {
this.eventBufferer.bufferEvents(() => this.spliceable.splice(start, deleteCount, elements));
this.view.domNode.setAttribute('aria-setsize', this.length.toString());
}
get length(): number {
......@@ -712,6 +714,11 @@ export class List<T> implements ISpliceable<T>, IDisposable {
setFocus(indexes: number[]): void {
indexes = indexes.sort(numericSort);
this.focus.set(indexes);
if (indexes.length) {
this.view.domNode.setAttribute('aria-posinset', (indexes[0] + 1).toString());
} else {
this.view.domNode.removeAttribute('aria-posinset');
}
}
focusNext(n = 1, loop = false): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册