Browse Source

fix(nc-gui): pass editEnabled as ref

pull/3816/head
braks 2 years ago
parent
commit
81fd277186
  1. 2
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 0
      packages/nc-gui/composables/index.ts
  3. 6
      packages/nc-gui/composables/useMultiSelect/index.ts

2
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,

0
packages/nc-gui/composables/index.ts

6
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
}

Loading…
Cancel
Save