From 7f71bfc47f774843cb5f6ee9cc72fa1e665a8d00 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Fri, 1 Nov 2019 10:43:54 +0300 Subject: [PATCH] Fixed singleton event problem with multiple cells --- src/components/datatable/BodyCell.vue | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/components/datatable/BodyCell.vue b/src/components/datatable/BodyCell.vue index b2e2d9d46..531b1026e 100644 --- a/src/components/datatable/BodyCell.vue +++ b/src/components/datatable/BodyCell.vue @@ -140,10 +140,21 @@ export default { } }, completeEdit(event, type) { - let editEvent = {originalEvent: event, data: this.rowData, field: this.column.field, index: this.index, type: type, preventDefault: () => event.preventDefault()}; - this.$emit('cell-edit-complete', editEvent); + let completeEvent = { + originalEvent: event, + data: this.rowData, + field: this.column.field, + index: this.index, + type: type, + defaultPrevented: false, + preventDefault: function() { + this.defaultPrevented = true; + } + }; + + this.$emit('cell-edit-complete', completeEvent); - if (!event.defaultPrevented) { + if (!completeEvent.defaultPrevented) { this.switchCellToViewMode(); } },