From bbf3b04bfb6403ddf0f29ee567d38964f6c54df3 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 17 Jan 2019 11:18:03 +0100 Subject: [PATCH] explroer: wasSelectedAndKeyboard --- .../parts/files/electron-browser/views/explorerView.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index f87a6a88c14..30e35834397 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -292,11 +292,11 @@ export class ExplorerView extends ViewletPanel { return; } const selection = e.elements; - const wasSelected = this.previousSelection.indexOf(selection[0]) >= 0; - this.previousSelection = selection; - // Do not react if the user is expanding selection. + // Do not react if the user is expanding selection via keyboard. // Check if the item was previously also selected, if yes the user is simply expanding / collapsing current selection #66589. - if (selection.length === 1 && !wasSelected) { + const wasSelectedAndKeyboard = (e.browserEvent instanceof KeyboardEvent) && this.previousSelection.indexOf(selection[0]) >= 0; + this.previousSelection = selection; + if (selection.length === 1 && !wasSelectedAndKeyboard) { // Do not react if user is clicking on explorer items which are input placeholders if (!selection[0].name) { // Do not react if user is clicking on explorer items which are input placeholders -- GitLab