list: select element when increasing selection range. Do not select element when removing it from selection

fixes #43233
This commit is contained in:
isidor 2018-02-16 17:05:57 +01:00
parent e47770acea
commit 5dc3c59343

View file

@ -462,15 +462,18 @@ class MouseController<T> implements IDisposable {
}
let reference = this.list.getFocus()[0];
reference = reference === undefined ? this.list.getSelection()[0] : reference;
const selection = this.list.getSelection();
reference = reference === undefined ? selection[0] : reference;
const focus = e.index;
if (selection.every(s => s !== focus)) {
this.list.setFocus([focus]);
}
if (this.multipleSelectionSupport && this.isSelectionRangeChangeEvent(e)) {
return this.changeSelection(e, reference);
}
const focus = e.index;
this.list.setFocus([focus]);
if (this.multipleSelectionSupport && this.isSelectionChangeEvent(e)) {
return this.changeSelection(e, reference);
}