forked from verdnatura/salix-front
fix: refs #8078 improve handleSelection
This commit is contained in:
parent
19a7e52605
commit
e39f85ff4b
|
@ -335,10 +335,13 @@ function handleScroll() {
|
||||||
function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
if (evt?.shiftKey && added) {
|
if (evt?.shiftKey && added) {
|
||||||
const rowIndex = selectedRows[0].$index;
|
const rowIndex = selectedRows[0].$index;
|
||||||
selected.value.length = 0;
|
const selectedIndexes = new Set(selected.value.map((row) => row.$index));
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
if (row.$index == rowIndex) break;
|
if (row.$index == rowIndex) break;
|
||||||
|
if (!selectedIndexes.has(row.$index)) {
|
||||||
selected.value.push(row);
|
selected.value.push(row);
|
||||||
|
selectedIndexes.add(row.$index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue