Browse Source

fix(gui): if expanded form is active skip grid view keyboard event actions

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4222/head
Pranav C 2 years ago
parent
commit
742a68deb0
  1. 14
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 1
      packages/nc-gui/components/smartsheet/expanded-form/index.vue

14
packages/nc-gui/components/smartsheet/Grid.vue

@ -181,6 +181,11 @@ const { selectCell, selectBlock, selectedRange, clearRangeRows, startSelectRange
return true return true
} }
// if expanded form is active skip keyboard event handling
if (document.querySelector('.nc-drawer-expanded-form.active')) {
return true
}
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey
if (e.key === ' ') { if (e.key === ' ') {
if (selected.row !== null && !editEnabled) { if (selected.row !== null && !editEnabled) {
@ -407,6 +412,11 @@ onClickOutside(smartTable, (e) => {
) )
return return
// if expanded form is active skip resetting the active cell
if (document.querySelector('.nc-drawer-expanded-form.active')) {
return
}
selected.row = null selected.row = null
selected.col = null selected.col = null
}) })
@ -457,8 +467,8 @@ const saveOrUpdateRecords = async (args: { metaValue?: TableType; viewMetaValue?
currentRow.rowMeta.changed = false currentRow.rowMeta.changed = false
for (const field of (args.metaValue || meta.value)?.columns ?? []) { for (const field of (args.metaValue || meta.value)?.columns ?? []) {
if (isVirtualCol(field)) continue if (isVirtualCol(field)) continue
if (field.title! in currentRow.row && currentRow.row[field.title!] !== currentRow.oldRow[field.title!]) { if (currentRow.row[field.title!] !== currentRow.oldRow[field.title!]) {
await updateOrSaveRow(currentRow, field.title!, {}, args) await updateOrSaveRow(currentRow, field.title!, args)
} }
} }
} }

1
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -137,6 +137,7 @@ export default {
:body-style="{ 'padding': 0, 'display': 'flex', 'flex-direction': 'column' }" :body-style="{ 'padding': 0, 'display': 'flex', 'flex-direction': 'column' }"
:closable="false" :closable="false"
class="nc-drawer-expanded-form" class="nc-drawer-expanded-form"
:class="{ 'active': isExpanded }"
> >
<SmartsheetExpandedFormHeader :view="props.view" @cancel="onClose" /> <SmartsheetExpandedFormHeader :view="props.view" @cancel="onClose" />

Loading…
Cancel
Save