better way of finding out active list (for #11517)

This commit is contained in:
Benjamin Pasero
2017-02-09 11:39:26 +01:00
parent 4617cb7f45
commit 4da71de482
6 changed files with 53 additions and 22 deletions

View File

@@ -286,7 +286,7 @@ export class List<T> implements IDisposable {
this.disposables = [this.focus, this.selection, this.view, this._onDispose];
const tracker = DOM.trackFocus(this.view.domNode);
this.disposables.push(tracker.addFocusListener(() => setTimeout(() => this._onDOMFocus.fire())));
this.disposables.push(tracker.addFocusListener(() => this._onDOMFocus.fire()));
this.disposables.push(tracker.addBlurListener(() => this._onDOMBlur.fire()));
if (typeof options.keyboardSupport !== 'boolean' || options.keyboardSupport) {
@@ -469,6 +469,10 @@ export class List<T> implements IDisposable {
return this.view.domNode === document.activeElement;
}
getHTMLElement(): HTMLElement {
return this.view.domNode;
}
private toListEvent({ indexes }: ITraitChangeEvent) {
return { indexes, elements: indexes.map(i => this.view.element(i)) };
}