提交 403f1874 编写于 作者: S Sandeep Somavarapu

#57935 - Single esc to come out of recording mode.

- Update placeholders and aria labels
上级 6057f650
......@@ -299,23 +299,19 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
private createHeader(parent: HTMLElement): void {
this.headerContainer = DOM.append(parent, $('.keybindings-header'));
const fullTextSearchPlaceholder = localize('SearchKeybindings.FullTextSearchPlaceholder', "Type to search in keybindings");
const keybindingsSearchPlaceholder = localize('SearchKeybindings.KeybindingsSearchPlaceholder', "Type keybindings to search");
const searchContainer = DOM.append(this.headerContainer, $('.search-container'));
this.searchWidget = this._register(this.instantiationService.createInstance(KeybindingsSearchWidget, searchContainer, <KeybindingsSearchOptions>{
ariaLabel: localize('SearchKeybindings.AriaLabel', "Search keybindings"),
placeholder: localize('SearchKeybindings.Placeholder', "Search keybindings"),
ariaLabel: fullTextSearchPlaceholder,
placeholder: fullTextSearchPlaceholder,
focusKey: this.searchFocusContextKey,
ariaLabelledBy: 'keybindings-editor-aria-label-element',
recordEnter: true
}));
this._register(this.searchWidget.onDidChange(searchValue => this.delayedFiltering.trigger(() => this.filterKeybindings())));
this._register(this.searchWidget.onEscape(() => {
if (this.searchWidget.getValue()) {
this.searchWidget.clear();
} else {
this.recordKeysAction.checked = false;
}
}));
this._register(this.searchWidget.onEscape(() => this.recordKeysAction.checked = false));
this.sortByPrecedenceAction = new Action('keybindings.editor.sortByPrecedence', localize('sortByPrecedene', "Sort by Precedence"), 'sort-by-precedence');
this.sortByPrecedenceAction.checked = false;
......@@ -330,9 +326,13 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
this._register(this.recordKeysAction.onDidChange(e => {
if (e.checked !== void 0) {
if (e.checked) {
this.searchWidget.inputBox.setPlaceHolder(keybindingsSearchPlaceholder);
this.searchWidget.inputBox.setAriaLabel(keybindingsSearchPlaceholder);
this.searchWidget.startRecordingKeys();
this.searchWidget.focus();
} else {
this.searchWidget.inputBox.setPlaceHolder(fullTextSearchPlaceholder);
this.searchWidget.inputBox.setAriaLabel(fullTextSearchPlaceholder);
this.searchWidget.stopRecordingKeys();
this.searchWidget.focus();
}
......
......@@ -570,7 +570,7 @@ export class SearchWidget extends Widget {
private countElement: HTMLElement;
private searchContainer: HTMLElement;
protected inputBox: InputBox;
inputBox: InputBox;
private controlsDiv: HTMLElement;
private readonly _onDidChange: Emitter<string> = this._register(new Emitter<string>());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册