Setting keybindings editor context in setInput lifecycle method instead of onFocus event
This commit is contained in:
parent
541418907a
commit
b6f6156e13
1 changed files with 2 additions and 5 deletions
|
@ -105,19 +105,16 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
|||
}
|
||||
|
||||
createEditor(parent: HTMLElement): void {
|
||||
const keybindingsEditorElement = DOM.append(parent, $('div', { class: 'keybindings-editor', tabIndex: -1 }));
|
||||
const keybindingsEditorElement = DOM.append(parent, $('div', { class: 'keybindings-editor' }));
|
||||
|
||||
this.createAriaLabelElement(keybindingsEditorElement);
|
||||
this.createOverlayContainer(keybindingsEditorElement);
|
||||
this.createHeader(keybindingsEditorElement);
|
||||
this.createBody(keybindingsEditorElement);
|
||||
|
||||
const focusTracker = this._register(DOM.trackFocus(parent));
|
||||
this._register(focusTracker.onDidFocus(() => this.keybindingsEditorContextKey.set(true)));
|
||||
this._register(focusTracker.onDidBlur(() => this.keybindingsEditorContextKey.reset()));
|
||||
}
|
||||
|
||||
setInput(input: KeybindingsEditorInput, options: EditorOptions, token: CancellationToken): Promise<void> {
|
||||
this.keybindingsEditorContextKey.set(true);
|
||||
return super.setInput(input, options, token)
|
||||
.then(() => this.render(options && options.preserveFocus, token));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue