提交 6b8c4b04 编写于 作者: B Benjamin Pasero

Revert "Only QuickNav if there was a keyDown since shown (fixes #83013)"

This reverts commit 8faa1d52.
上级 f91e3ee2
......@@ -135,7 +135,6 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
private styles: IQuickOpenStyles;
// @ts-ignore (legacy widget - to be replaced with quick input)
private renderer: Renderer;
private keyDownSeenSinceShown = false;
constructor(container: HTMLElement, callbacks: IQuickOpenCallbacks, options: IQuickOpenOptions) {
super();
......@@ -172,7 +171,6 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
this._register(DOM.addDisposableListener(this.element, DOM.EventType.FOCUS, e => this.gainingFocus(), true));
this._register(DOM.addDisposableListener(this.element, DOM.EventType.BLUR, e => this.loosingFocus(e), true));
this._register(DOM.addDisposableListener(this.element, DOM.EventType.KEY_DOWN, e => {
this.keyDownSeenSinceShown = true;
const keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);
if (keyboardEvent.keyCode === KeyCode.Escape) {
DOM.EventHelper.stop(e, true);
......@@ -223,7 +221,6 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
this._register(DOM.addDisposableListener(this.inputBox.inputElement, DOM.EventType.INPUT, (e: Event) => this.onType()));
this._register(DOM.addDisposableListener(this.inputBox.inputElement, DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
this.keyDownSeenSinceShown = true;
const keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);
const shouldOpenInBackground = this.shouldOpenInBackground(keyboardEvent);
......@@ -304,7 +301,6 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
}));
this._register(DOM.addDisposableListener(this.treeContainer, DOM.EventType.KEY_DOWN, e => {
this.keyDownSeenSinceShown = true;
const keyboardEvent: StandardKeyboardEvent = new StandardKeyboardEvent(e);
// Only handle when in quick navigation mode
......@@ -325,7 +321,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
const keyCode = keyboardEvent.keyCode;
// Only handle when in quick navigation mode
if (!this.quickNavigateConfiguration || !this.keyDownSeenSinceShown) {
if (!this.quickNavigateConfiguration) {
return;
}
......@@ -600,7 +596,6 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
this.visible = true;
this.isLoosingFocus = false;
this.quickNavigateConfiguration = options ? options.quickNavigateConfiguration : undefined;
this.keyDownSeenSinceShown = false;
// Adjust UI for quick navigate mode
if (this.quickNavigateConfiguration) {
......
......@@ -84,7 +84,6 @@ interface QuickInputUI {
onDidTriggerButton: Event<IQuickInputButton>;
ignoreFocusOut: boolean;
keyMods: Writeable<IKeyMods>;
keyDownSeenSinceShown: boolean;
isScreenReaderOptimized(): boolean;
show(controller: QuickInput): void;
setVisibilities(visibilities: Visibilities): void;
......@@ -217,7 +216,6 @@ class QuickInput extends Disposable implements IQuickInput {
}
}),
);
this.ui.keyDownSeenSinceShown = false;
this.ui.show(this);
this.visible = true;
this.update();
......@@ -556,7 +554,6 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
}
}));
this.visibleDisposables.add(this.ui.inputBox.onKeyDown(event => {
this.ui.keyDownSeenSinceShown = true;
switch (event.keyCode) {
case KeyCode.DownArrow:
this.ui.list.focus('Next');
......@@ -655,7 +652,7 @@ class QuickPick<T extends IQuickPickItem> extends QuickInput implements IQuickPi
private registerQuickNavigation() {
return dom.addDisposableListener(this.ui.container, dom.EventType.KEY_UP, e => {
if (this.canSelectMany || !this.quickNavigate || !this.ui.keyDownSeenSinceShown) {
if (this.canSelectMany || !this.quickNavigate) {
return;
}
......@@ -1114,7 +1111,6 @@ export class QuickInputService extends Component implements IQuickInputService {
inputBox.setFocus();
}));
this._register(dom.addDisposableListener(container, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => {
this.getUI().keyDownSeenSinceShown = true;
const event = new StandardKeyboardEvent(e);
switch (event.keyCode) {
case KeyCode.Enter:
......@@ -1176,7 +1172,6 @@ export class QuickInputService extends Component implements IQuickInputService {
onDidTriggerButton: this.onDidTriggerButtonEmitter.event,
ignoreFocusOut: false,
keyMods: this.keyMods,
keyDownSeenSinceShown: false,
isScreenReaderOptimized: () => this.isScreenReaderOptimized(),
show: controller => this.show(controller),
hide: () => this.hide(),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册