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 f87a6a88c14d66fec2b1f4e4b0b6b4f660da8924..30e35834397b69376d529f19c8a6921b10b0f024 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