From 81fd2771864f19a723c4680b0400b5b8faa848d9 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Mon, 26 Sep 2022 21:02:21 +0200 Subject: [PATCH] fix(nc-gui): pass editEnabled as ref --- packages/nc-gui/components/smartsheet/Grid.vue | 2 +- packages/nc-gui/composables/index.ts | 0 packages/nc-gui/composables/useMultiSelect/index.ts | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 packages/nc-gui/composables/index.ts diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 5ec5235aeb..8e86d07c01 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -102,7 +102,7 @@ const { loadGridViewColumns, updateWidth, resizingColWidth, resizingCol } = useG const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange, selected } = useMultiSelect( fields, data, - editEnabled, + $$(editEnabled), isPkAvail, clearCell, makeEditable, diff --git a/packages/nc-gui/composables/index.ts b/packages/nc-gui/composables/index.ts deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/nc-gui/composables/useMultiSelect/index.ts b/packages/nc-gui/composables/useMultiSelect/index.ts index 6e6db8cbcd..0315a57a8c 100644 --- a/packages/nc-gui/composables/useMultiSelect/index.ts +++ b/packages/nc-gui/composables/useMultiSelect/index.ts @@ -168,7 +168,7 @@ export function useMultiSelect( break /** on delete key press clear cell */ case 'Delete': - if (!editEnabled) { + if (!unref(editEnabled)) { e.preventDefault() clearRangeRows() await clearCell(selected as { row: number; col: number }) @@ -224,7 +224,7 @@ export function useMultiSelect( cptext = rowObj.row[columnObj.title] || '' } - if ((!editEnabled && e.metaKey) || e.ctrlKey) { + if ((!unref(editEnabled) && e.metaKey) || e.ctrlKey) { switch (e.keyCode) { // copy - ctrl/cmd +c case 67: @@ -233,7 +233,7 @@ export function useMultiSelect( } } - if (editEnabled || e.ctrlKey || e.altKey || e.metaKey) { + if (unref(editEnabled) || e.ctrlKey || e.altKey || e.metaKey) { return }