mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-11 19:08:20 +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) {
|
function rowSelection(index: number) {
|
||||||
if (shiftState) {
|
if (shiftState) {
|
||||||
let last = selection[selection.length-1];
|
if (selection.length === 0) {
|
||||||
let start = index;
|
selection = [index];
|
||||||
let end = last;
|
} else {
|
||||||
if (last < start) {
|
let last = selection[selection.length-1];
|
||||||
start = last;
|
let start = index;
|
||||||
end = index;
|
let end = last;
|
||||||
}
|
if (last < start) {
|
||||||
for (let i = start; i < end; i++ ) {
|
start = last;
|
||||||
if (!selection.includes(i)) {
|
end = index;
|
||||||
selection = [...selection, i];
|
}
|
||||||
|
for (let i = start; i <= end; i++ ) {
|
||||||
|
if (!selection.includes(i)) {
|
||||||
|
selection = [...selection, i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ctrlState) {
|
} else if (ctrlState) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue