提交 2aef9dcf 编写于 作者: I isidor

react on comments

上级 287f4f1a
......@@ -651,6 +651,7 @@ 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', this.length.toString());
this.style(options);
}
......@@ -658,8 +659,8 @@ export class List<T> implements ISpliceable<T>, IDisposable {
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());
});
this.view.domNode.setAttribute('aria-setsize', this.length.toString());
}
get length(): number {
......@@ -715,7 +716,11 @@ export class List<T> implements ISpliceable<T>, IDisposable {
setFocus(indexes: number[]): void {
indexes = indexes.sort(numericSort);
this.focus.set(indexes);
this.view.domNode.setAttribute('aria-posinset', indexes.length ? (indexes[0] + 1).toString() : undefined);
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.
先完成此消息的编辑!
想要评论请 注册