Browse Source

feat(nc-gui): revise clear cell logic

pull/4482/head
Wing-Kam Wong 2 years ago
parent
commit
9250aa8250
  1. 8
      packages/nc-gui/components/smartsheet/Grid.vue

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

@ -242,7 +242,6 @@ const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange
if (altOrOptionKey) { if (altOrOptionKey) {
switch (e.keyCode) { switch (e.keyCode) {
// wingkwong
case 82: { case 82: {
// ALT + R // ALT + R
if (isAddingEmptyRowAllowed) { if (isAddingEmptyRowAllowed) {
@ -368,7 +367,12 @@ 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) {
if (!ctx) return if (
!ctx ||
!hasEditPermission ||
(fields.value[ctx.col].uidt !== UITypes.LinkToAnotherRecord && isVirtualCol(fields.value[ctx.col]))
)
return
const rowObj = data.value[ctx.row] const rowObj = data.value[ctx.row]
const columnObj = fields.value[ctx.col] const columnObj = fields.value[ctx.col]

Loading…
Cancel
Save