mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
split view header keyboard access
This commit is contained in:
@@ -49,6 +49,8 @@ export class FindInput extends Widget {
|
||||
private validation:IInputValidator;
|
||||
private label:string;
|
||||
|
||||
private optionsKeyListener: () => void;
|
||||
|
||||
private regex:Checkbox;
|
||||
private wholeWords:Checkbox;
|
||||
private caseSensitive:Checkbox;
|
||||
@@ -247,10 +249,8 @@ export class FindInput extends Widget {
|
||||
|
||||
// Arrow-Key support to navigate between options
|
||||
let indexes = [this.caseSensitive.domNode, this.wholeWords.domNode, this.regex.domNode];
|
||||
this.domNode.addEventListener(dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
this.optionsKeyListener = dom.addListener(this.domNode, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
let event = new StandardKeyboardEvent(e);
|
||||
let eventHandled = false;
|
||||
|
||||
if (event.equals(CommonKeybindings.LEFT_ARROW) || event.equals(CommonKeybindings.RIGHT_ARROW) || event.equals(CommonKeybindings.ESCAPE)) {
|
||||
let index = indexes.indexOf(<HTMLElement>document.activeElement);
|
||||
if (index >= 0) {
|
||||
@@ -271,8 +271,7 @@ export class FindInput extends Widget {
|
||||
indexes[newIndex].focus();
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
dom.EventHelper.stop(event, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -304,6 +303,15 @@ export class FindInput extends Widget {
|
||||
private clearValidation(): void {
|
||||
this.inputBox.hideMessage();
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
if (this.optionsKeyListener) {
|
||||
this.optionsKeyListener();
|
||||
this.optionsKeyListener = null;
|
||||
}
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
interface IMatchCountOpts {
|
||||
|
||||
Reference in New Issue
Block a user