From ecc64e0169cd8765b14315428b546032debbc54f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 9 Mar 2023 11:37:39 +0530 Subject: [PATCH] refactor(gui): show default system context menu when cell is in editable state and typable Signed-off-by: Pranav C --- packages/nc-gui/components/cell/Currency.vue | 1 + packages/nc-gui/components/smartsheet/Cell.vue | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/packages/nc-gui/components/cell/Currency.vue b/packages/nc-gui/components/cell/Currency.vue index 9aa50944c5..bdef2b4b0c 100644 --- a/packages/nc-gui/components/cell/Currency.vue +++ b/packages/nc-gui/components/cell/Currency.vue @@ -81,6 +81,7 @@ onMounted(() => { @keydown.delete.stop @selectstart.capture.stop @mousedown.stop + @contextmenu.stop /> NULL diff --git a/packages/nc-gui/components/smartsheet/Cell.vue b/packages/nc-gui/components/smartsheet/Cell.vue index be23b134d5..f39454f7f4 100644 --- a/packages/nc-gui/components/smartsheet/Cell.vue +++ b/packages/nc-gui/components/smartsheet/Cell.vue @@ -139,6 +139,15 @@ const isNumericField = computed(() => { isDuration(column.value) ) }) + +// disable contexxtmenu event propagation when cell is in +// editable state and typable (e.g. text area) +// this is to prevent the custom grid view context menu from opening +const onContextmenu = (e: MouseEvent) => { + if (props.editEnabled && isTypableInputColumn(column.value)) { + e.stopPropagation() + } +}