react on comments

This commit is contained in:
isidor
2017-06-19 16:38:26 +02:00
parent 287f4f1a13
commit 2aef9dcf2c

View File

@@ -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 {