mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 23:36:40 +00:00
fix: clear selection if row deleted is included
Signed-off-by: mertmit <mertmit99@gmail.com>
This commit is contained in:
@@ -24,6 +24,24 @@ export class CellRange {
|
||||
return !this.isEmpty() && this._start?.row === this._end?.row
|
||||
}
|
||||
|
||||
isCellInRange(cell: Cell) {
|
||||
return (
|
||||
!this.isEmpty() &&
|
||||
cell.row >= this.start.row &&
|
||||
cell.row <= this.end.row &&
|
||||
cell.col >= this.start.col &&
|
||||
cell.col <= this.end.col
|
||||
)
|
||||
}
|
||||
|
||||
isRowInRange(row: number) {
|
||||
return !this.isEmpty() && row >= this.start.row && row <= this.end.row
|
||||
}
|
||||
|
||||
isColInRange(col: number) {
|
||||
return !this.isEmpty() && col >= this.start.col && col <= this.end.col
|
||||
}
|
||||
|
||||
get start(): Cell {
|
||||
return {
|
||||
row: Math.min(this._start?.row ?? NaN, this._end?.row ?? NaN),
|
||||
|
||||
@@ -232,16 +232,7 @@ export function useMultiSelect(
|
||||
return true
|
||||
}
|
||||
|
||||
if (selectedRange._start === null || selectedRange._end === null) {
|
||||
return false
|
||||
}
|
||||
|
||||
return (
|
||||
col >= selectedRange.start.col &&
|
||||
col <= selectedRange.end.col &&
|
||||
row >= selectedRange.start.row &&
|
||||
row <= selectedRange.end.row
|
||||
)
|
||||
return selectedRange.isCellInRange({ row, col })
|
||||
}
|
||||
|
||||
function isCellInFillRange(row: number, col: number) {
|
||||
@@ -249,16 +240,11 @@ export function useMultiSelect(
|
||||
return false
|
||||
}
|
||||
|
||||
if (
|
||||
col >= selectedRange.start.col &&
|
||||
col <= selectedRange.end.col &&
|
||||
row >= selectedRange.start.row &&
|
||||
row <= selectedRange.end.row
|
||||
) {
|
||||
if (selectedRange.isCellInRange({ row, col })) {
|
||||
return false
|
||||
}
|
||||
|
||||
return col >= fillRange.start.col && col <= fillRange.end.col && row >= fillRange.start.row && row <= fillRange.end.row
|
||||
return fillRange.isCellInRange({ row, col })
|
||||
}
|
||||
|
||||
const isPasteable = (row?: Row, col?: ColumnType, showInfo = false) => {
|
||||
|
||||
Reference in New Issue
Block a user