Skip to content

Commit b894556

Browse files
committed
fix(editing): await reactive changes to access the latest cell data
1 parent bd0a270 commit b894556

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/primevue/src/datatable/BodyCell.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,20 +401,22 @@ export default {
401401
}
402402
}
403403
},
404-
moveToPreviousCell(event) {
404+
async moveToPreviousCell(event) {
405405
let currentCell = this.findCell(event.target);
406406
let targetCell = this.findPreviousEditableColumn(currentCell);
407407
408408
if (targetCell) {
409+
await this.$nextTick();
409410
invokeElementMethod(targetCell, 'click');
410411
event.preventDefault();
411412
}
412413
},
413-
moveToNextCell(event) {
414+
async moveToNextCell(event) {
414415
let currentCell = this.findCell(event.target);
415416
let targetCell = this.findNextEditableColumn(currentCell);
416417
417418
if (targetCell) {
419+
await this.$nextTick();
418420
invokeElementMethod(targetCell, 'click');
419421
event.preventDefault();
420422
}

0 commit comments

Comments
 (0)