提交 93b0145d 编写于 作者: I isidor

explorer: do not react on selection events if user is modifying selection via shift

fixes #66792
上级 b29504c5
......@@ -115,7 +115,7 @@ export function registerCommands(): void {
const focus = list.getFocus() ? list.getFocus()[0] : undefined;
const selection = list.getSelection();
const fakeKeyboardEvent = new KeyboardEvent('keydown');
const fakeKeyboardEvent = new KeyboardEvent('keydown', { shiftKey: true });
if (selection && selection.indexOf(focus) >= 0) {
list.setSelection(selection.filter(s => s !== previousFocus), fakeKeyboardEvent);
......
......@@ -64,7 +64,6 @@ export class ExplorerView extends ViewletPanel {
private decorationProvider: ExplorerDecorationsProvider;
private autoReveal = false;
private ignoreActiveEditorChange;
private previousSelection: ExplorerItem[] = [];
constructor(
options: IViewletPanelOptions,
......@@ -294,9 +293,9 @@ export class ExplorerView extends ViewletPanel {
const selection = e.elements;
// 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.
const wasMultiSelectedAndKeyboard = (e.browserEvent instanceof KeyboardEvent) && this.previousSelection.length > 1 && this.previousSelection.indexOf(selection[0]) >= 0;
this.previousSelection = selection;
if (selection.length === 1 && !wasMultiSelectedAndKeyboard) {
const shiftDown = e.browserEvent instanceof KeyboardEvent && e.browserEvent.shiftKey;
if (selection.length === 1 && !shiftDown) {
// 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册