From 9250aa82505ad17c6176504e0ec4ea37b43c7e37 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 24 Nov 2022 19:23:31 +0800 Subject: [PATCH] feat(nc-gui): revise clear cell logic --- packages/nc-gui/components/smartsheet/Grid.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index e56ebc7f75..5016ba6453 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -242,7 +242,6 @@ const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange if (altOrOptionKey) { switch (e.keyCode) { - // wingkwong case 82: { // ALT + R if (isAddingEmptyRowAllowed) { @@ -368,7 +367,12 @@ watch(contextMenu, () => { const rowRefs = $ref() 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 columnObj = fields.value[ctx.col]