Browse Source

fix: handle consecutive updates of different rows

re #734

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/763/head
Pranav C 3 years ago
parent
commit
c385f847c8
  1. 2
      packages/nc-gui/components/project/spreadsheet/components/editableCell.vue
  2. 16
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

2
packages/nc-gui/components/project/spreadsheet/components/editableCell.vue

@ -196,8 +196,8 @@ export default {
}, },
set(val) { set(val) {
this.changed = true this.changed = true
if (val !== this.value) { this.syncDataDebounce(this) }
this.$emit('input', val) this.$emit('input', val)
this.syncDataDebounce(this)
} }
}, },
parentListeners() { parentListeners() {

16
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -878,14 +878,14 @@ export default {
} }
} }
}, },
// todo: move debounce to cell since this will skip few update api call // // todo: move debounce to cell since this will skip few update api call
onCellValueChangeDebounce: debounce(async function(col, row, column, self) { // onCellValueChangeDebounce: debounce(async function(col, row, column, self) {
await self.onCellValueChangeFn(col, row, column) // await self.onCellValueChangeFn(col, row, column)
}, 100), // }, 100),
onCellValueChange(col, row, column) { // onCellValueChange(col, row, column) {
this.onCellValueChangeDebounce(col, row, column, this) // this.onCellValueChangeFn(col, row, column)
}, // },
async onCellValueChangeFn(col, row, column) { async onCellValueChange(col, row, column) {
if (!this.data[row]) { if (!this.data[row]) {
return return
} }

Loading…
Cancel
Save