Skip to content

Commit bbf3b04

Browse files
committed
explroer: wasSelectedAndKeyboard
1 parent 24b75da commit bbf3b04

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/vs/workbench/parts/files/electron-browser/views/explorerView.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ export class ExplorerView extends ViewletPanel {
292292
return;
293293
}
294294
const selection = e.elements;
295-
const wasSelected = this.previousSelection.indexOf(selection[0]) >= 0;
296-
this.previousSelection = selection;
297-
// Do not react if the user is expanding selection.
295+
// Do not react if the user is expanding selection via keyboard.
298296
// Check if the item was previously also selected, if yes the user is simply expanding / collapsing current selection #66589.
299-
if (selection.length === 1 && !wasSelected) {
297+
const wasSelectedAndKeyboard = (e.browserEvent instanceof KeyboardEvent) && this.previousSelection.indexOf(selection[0]) >= 0;
298+
this.previousSelection = selection;
299+
if (selection.length === 1 && !wasSelectedAndKeyboard) {
300300
// Do not react if user is clicking on explorer items which are input placeholders
301301
if (!selection[0].name) {
302302
// Do not react if user is clicking on explorer items which are input placeholders

0 commit comments

Comments
 (0)