Fix rows not deselecting with single click on one item.

Closes #2241
This commit is contained in:
Adomas Venčkauskas 2021-11-08 14:06:23 +02:00
parent 80be9f9e3a
commit b9e1923656
2 changed files with 4 additions and 5 deletions

View file

@ -687,9 +687,7 @@ class VirtualizedTable extends React.Component {
this._isMouseDrag = false;
return;
}
if (shiftSelect || toggleSelection) {
this._onSelection(index, shiftSelect, toggleSelection);
}
this._onSelection(index, shiftSelect, toggleSelection);
}
_activateNode = (event, indices) => {

View file

@ -2664,13 +2664,14 @@ var ItemTree = class ItemTree extends LibraryTree {
this.onDrop(e, index);
}, { passive: true });
}
div.addEventListener('mousedown', e => this._handleRowMouseDown(e, index), { passive : true });
div.addEventListener('mousedown', this._handleRowMouseUpDown, { passive: true });
div.addEventListener('mouseup', this._handleRowMouseUpDown, { passive: true });
}
return div;
};
_handleRowMouseDown = (event, index) => {
_handleRowMouseUpDown = (event) => {
const modifierIsPressed = ['ctrlKey', 'metaKey', 'shiftKey', 'altKey'].some(key => event[key]);
if (this.collectionTreeRow.isDuplicates() && !modifierIsPressed) {
this.duplicateMouseSelection = true;