diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 1e949120f..dc8671369 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -335,10 +335,13 @@ function handleScroll() { function handleSelection({ evt, added, rows: selectedRows }, rows) { if (evt?.shiftKey && added) { const rowIndex = selectedRows[0].$index; - selected.value.length = 0; + const selectedIndexes = new Set(selected.value.map((row) => row.$index)); for (const row of rows) { if (row.$index == rowIndex) break; - selected.value.push(row); + if (!selectedIndexes.has(row.$index)) { + selected.value.push(row); + selectedIndexes.add(row.$index); + } } } }