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( const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange, selected } = useMultiSelect(
fields, fields,
data, data,
editEnabled, $$(editEnabled),
isPkAvail, isPkAvail,
clearCell, clearCell,
makeEditable, makeEditable,

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

6
packages/nc-gui/composables/useMultiSelect/index.ts

@ -168,7 +168,7 @@ export function useMultiSelect(
break break
/** on delete key press clear cell */ /** on delete key press clear cell */
case 'Delete': case 'Delete':
if (!editEnabled) { if (!unref(editEnabled)) {
e.preventDefault() e.preventDefault()
clearRangeRows() clearRangeRows()
await clearCell(selected as { row: number; col: number }) await clearCell(selected as { row: number; col: number })
@ -224,7 +224,7 @@ export function useMultiSelect(
cptext = rowObj.row[columnObj.title] || '' cptext = rowObj.row[columnObj.title] || ''
} }
if ((!editEnabled && e.metaKey) || e.ctrlKey) { if ((!unref(editEnabled) && e.metaKey) || e.ctrlKey) {
switch (e.keyCode) { switch (e.keyCode) {
// copy - ctrl/cmd +c // copy - ctrl/cmd +c
case 67: 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 return
} }

Loading…
Cancel
Save