Browse Source

feat(gui): allow pasting value directly to cell

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4514/head
Pranav C 2 years ago
parent
commit
ecea8cc262
  1. 5
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 3
      packages/nc-gui/composables/useMultiSelect/index.ts

5
packages/nc-gui/components/smartsheet/Grid.vue

@ -369,7 +369,7 @@ watch(contextMenu, () => {
const rowRefs = $ref<any[]>() const rowRefs = $ref<any[]>()
async function clearCell(ctx: { row: number; col: number } | null) { async function clearCell(ctx: { row: number; col: number } | null, skipUpdate = false) {
if ( if (
!ctx || !ctx ||
!hasEditPermission || !hasEditPermission ||
@ -386,8 +386,11 @@ async function clearCell(ctx: { row: number; col: number } | null) {
} }
rowObj.row[columnObj.title] = null rowObj.row[columnObj.title] = null
if (!skipUpdate) {
// update/save cell value // update/save cell value
await updateOrSaveRow(rowObj, columnObj.title) await updateOrSaveRow(rowObj, columnObj.title)
}
} }
function makeEditable(row: Row, col: ColumnType) { function makeEditable(row: Row, col: ColumnType) {

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

@ -223,6 +223,9 @@ export function useMultiSelect(
case 67: case 67:
await copyValue() await copyValue()
break break
case 86:
clearCell(selected as { row: number; col: number }, true)
makeEditable(rowObj, columnObj)
} }
} }

Loading…
Cancel
Save