Browse Source

fix(gui): avoid rendering cell component while switching tab

- to avoid passing wrong(previous tabs data) data to cell

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4405/head
Pranav C 2 years ago
parent
commit
e074b6338e
  1. 7
      packages/nc-gui/components/smartsheet/Grid.vue

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

@ -521,11 +521,14 @@ provide(ReloadRowDataHookInj, reloadViewDataHook)
// trigger initial data load in grid
// reloadViewDataHook.trigger()
const switchingTab = ref(false)
watch(
view,
async (next, old) => {
try {
if (next && next.id !== old?.id) {
switchingTab.value = true
// whenever tab changes or view changes save any unsaved data
if (old?.id) {
const oldMeta = await getMeta(old.fk_model_id!)
@ -541,6 +544,8 @@ watch(
}
} catch (e) {
console.log(e)
} finally {
switchingTab.value = false
}
},
{ immediate: true },
@ -707,7 +712,7 @@ watch(
@mouseover="selectBlock(rowIndex, colIndex)"
@contextmenu="showContextMenu($event, { row: rowIndex, col: colIndex })"
>
<div class="w-full h-full">
<div class="w-full h-full" v-if="!switchingTab">
<LazySmartsheetVirtualCell
v-if="isVirtualCol(columnObj)"
v-model="row.row[columnObj.title]"

Loading…
Cancel
Save