diff --git a/packages/nc-gui/components/smartsheet/Cell.vue b/packages/nc-gui/components/smartsheet/Cell.vue index fb8fb8d7c4..75fa3ebb0b 100644 --- a/packages/nc-gui/components/smartsheet/Cell.vue +++ b/packages/nc-gui/components/smartsheet/Cell.vue @@ -112,6 +112,17 @@ const syncValue = useDebounceFn( { maxWait: 2000 }, ) +const saveTimer = ref() + +const updateWhenEditCompleted = () => { + if (editEnabled.value) { + if (saveTimer.value) clearTimeout(saveTimer.value) + saveTimer.value = setTimeout(updateWhenEditCompleted, 500) + } else { + emit('save') + } +} + const vModel = computed({ get: () => { return props.modelValue @@ -122,7 +133,9 @@ const vModel = computed({ } else if (val !== props.modelValue) { currentRow.value.rowMeta.changed = true emit('update:modelValue', val) - if (isAutoSaved(column.value)) { + if (column.value.pk) { + updateWhenEditCompleted() + } else if (isAutoSaved(column.value)) { syncValue() } else if (!isManualSaved(column.value)) { emit('save')