mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 02:48:21 +00:00
fix shift selection bugs
This commit is contained in:
parent
d97f7a4e93
commit
262ecc81d4
1 changed files with 14 additions and 10 deletions
|
@ -49,16 +49,20 @@ function toggleSorting(columnName: string) {
|
|||
|
||||
function rowSelection(index: number) {
|
||||
if (shiftState) {
|
||||
let last = selection[selection.length-1];
|
||||
let start = index;
|
||||
let end = last;
|
||||
if (last < start) {
|
||||
start = last;
|
||||
end = index;
|
||||
}
|
||||
for (let i = start; i < end; i++ ) {
|
||||
if (!selection.includes(i)) {
|
||||
selection = [...selection, i];
|
||||
if (selection.length === 0) {
|
||||
selection = [index];
|
||||
} else {
|
||||
let last = selection[selection.length-1];
|
||||
let start = index;
|
||||
let end = last;
|
||||
if (last < start) {
|
||||
start = last;
|
||||
end = index;
|
||||
}
|
||||
for (let i = start; i <= end; i++ ) {
|
||||
if (!selection.includes(i)) {
|
||||
selection = [...selection, i];
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (ctrlState) {
|
||||
|
|
Loading…
Add table
Reference in a new issue