diff --git a/src/components/VnTable/VnTable.vue b/src/components/VnTable/VnTable.vue index 74a96e0e3..a15ba2f47 100644 --- a/src/components/VnTable/VnTable.vue +++ b/src/components/VnTable/VnTable.vue @@ -335,8 +335,9 @@ function handleScroll() { function handleSelection({ evt, added, rows: selectedRows }, rows) { if (evt?.shiftKey && added) { const rowIndex = selectedRows[0].$index; + selected.value.length = 0; for (const row of rows) { - if (row.$index > rowIndex) break; + if (row.$index == rowIndex) break; selected.value.push(row); } } @@ -440,7 +441,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) { :virtual-scroll="isTableMode" @virtual-scroll="handleScroll" @row-click="(_, row) => rowClickFunction && rowClickFunction(row)" - @update:selected="emit('update:selected', $event)" @selection="(details) => handleSelection(details, rows)" >