0
0
Fork 0

fix: refs #8078 handleSelection

This commit is contained in:
Jorge Penadés 2024-10-29 09:38:40 +01:00
parent 71420da586
commit 77cb2d84be
1 changed files with 2 additions and 2 deletions

View File

@ -335,8 +335,9 @@ 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;
for (const row of rows) { for (const row of rows) {
if (row.$index > rowIndex) break; if (row.$index == rowIndex) break;
selected.value.push(row); selected.value.push(row);
} }
} }
@ -440,7 +441,6 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
:virtual-scroll="isTableMode" :virtual-scroll="isTableMode"
@virtual-scroll="handleScroll" @virtual-scroll="handleScroll"
@row-click="(_, row) => rowClickFunction && rowClickFunction(row)" @row-click="(_, row) => rowClickFunction && rowClickFunction(row)"
@update:selected="emit('update:selected', $event)"
@selection="(details) => handleSelection(details, rows)" @selection="(details) => handleSelection(details, rows)"
> >
<template #top-left v-if="!$props.withoutHeader"> <template #top-left v-if="!$props.withoutHeader">