From 8041389e2a610732bd4405d7eef6d44f9d359bb6 Mon Sep 17 00:00:00 2001 From: Giga Chubinidze Date: Tue, 24 Oct 2023 11:12:07 +0400 Subject: [PATCH] CAPA - Large handson table on bottom of page --- app/javascript/vue/shared/content/table.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/javascript/vue/shared/content/table.vue b/app/javascript/vue/shared/content/table.vue index 4982ab1a5..c2339224e 100644 --- a/app/javascript/vue/shared/content/table.vue +++ b/app/javascript/vue/shared/content/table.vue @@ -146,9 +146,10 @@ this.openNameModal(); return; } + const { row = 0, col = 0 } = this.selectedCell || {}; this.editingTable = true; - this.$nextTick(() => this.tableObject.selectCell(0,0)); + this.$nextTick(() => this.tableObject.selectCell(row, col)); }, disableTableEdit() { this.editingTable = false; @@ -254,6 +255,11 @@ afterUnlisten: () => { this.updatingTableData = true; setTimeout(this.updateTable, 100) // delay makes cancel button work + }, + afterSelection: (r, c, r2, c2) => { + if (r === r2 && c === c2) { + this.selectedCell = { row: r, col: c }; + } } }); this.$nextTick(this.tableObject.render);