Browse Source

fix: skip front-end columns on paste for now

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/5847/head
mertmit 1 year ago
parent
commit
dbc9272a45
  1. 15
      packages/nc-gui/composables/useMultiSelect/index.ts

15
packages/nc-gui/composables/useMultiSelect/index.ts

@ -521,8 +521,15 @@ export function useMultiSelect(
const rowsToPaste = unref(data).slice(activeCell.row, activeCell.row + pasteMatrixRows) const rowsToPaste = unref(data).slice(activeCell.row, activeCell.row + pasteMatrixRows)
const propsToPaste: string[] = [] const propsToPaste: string[] = []
let pastedRows = 0
for (let i = 0; i < pasteMatrixRows; i++) { for (let i = 0; i < pasteMatrixRows; i++) {
const pasteRow = rowsToPaste[i] const pasteRow = rowsToPaste[i]
// TODO handle insert new row
if (pasteRow.rowMeta.new) break
pastedRows++
for (let j = 0; j < pasteMatrixCols; j++) { for (let j = 0; j < pasteMatrixCols; j++) {
const pasteCol = colsToPaste[j] const pasteCol = colsToPaste[j]
@ -565,9 +572,11 @@ export function useMultiSelect(
} }
await bulkUpdateRows?.(rowsToPaste, propsToPaste) await bulkUpdateRows?.(rowsToPaste, propsToPaste)
// highlight the pasted range if (pastedRows > 0) {
selectedRange.startRange({ row: activeCell.row, col: activeCell.col }) // highlight the pasted range
selectedRange.endRange({ row: activeCell.row + pasteMatrixRows - 1, col: activeCell.col + pasteMatrixCols - 1 }) selectedRange.startRange({ row: activeCell.row, col: activeCell.col })
selectedRange.endRange({ row: activeCell.row + pastedRows - 1, col: activeCell.col + pasteMatrixCols - 1 })
}
} else { } else {
// handle belongs to column // handle belongs to column
if ( if (

Loading…
Cancel
Save