Skip to content

Commit

Permalink
List: set aria-setsize and aria-posinset
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Jun 19, 2017
1 parent 7295647 commit 287f4f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,10 @@ 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.eventBufferer.bufferEvents(() => {
this.spliceable.splice(start, deleteCount, elements);
this.view.domNode.setAttribute('aria-setsize', this.length.toString());
});
}

get length(): number {
Expand Down Expand Up @@ -712,6 +715,7 @@ 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);
}

focusNext(n = 1, loop = false): void {
Expand Down

0 comments on commit 287f4f1

Please sign in to comment.