From 6bb854ad01fc57adedf20f0ba003b3fc69a1778b Mon Sep 17 00:00:00 2001 From: Wojciech Szymanski <141330+wszymanski@users.noreply.github.com> Date: Wed, 22 Sep 2021 14:50:21 +0200 Subject: [PATCH] Fixed problem with populating data and handling data changes in the Formulas plugin #7031 --- src/dataMap/metaManager/mods/dynamicCellMeta.js | 3 ++- src/plugins/formulas/formulas.js | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dataMap/metaManager/mods/dynamicCellMeta.js b/src/dataMap/metaManager/mods/dynamicCellMeta.js index 25d8c034687..7dfb8d7aebc 100644 --- a/src/dataMap/metaManager/mods/dynamicCellMeta.js +++ b/src/dataMap/metaManager/mods/dynamicCellMeta.js @@ -63,7 +63,8 @@ export class DynamicCellMetaMod { visualCol, } = cellMeta; const hot = this.metaManager.hot; - const prop = hot.colToProp(visualCol); + const colFromProp = hot.colToProp(visualCol); + const prop = colFromProp === null ? visualCol : colFromProp; cellMeta.prop = prop; diff --git a/src/plugins/formulas/formulas.js b/src/plugins/formulas/formulas.js index 436e387b239..f9e546f2d57 100644 --- a/src/plugins/formulas/formulas.js +++ b/src/plugins/formulas/formulas.js @@ -748,12 +748,14 @@ export class Formulas extends BasePlugin { const changedCells = []; changes.forEach(([row, prop, , newValue]) => { - const column = this.hot.propToCol(prop); + const colFromProp = this.hot.propToCol(prop); + const column = colFromProp === null ? prop : colFromProp; const physicalRow = this.hot.toPhysicalRow(row); const physicalColumn = this.hot.toPhysicalColumn(column); + const address = { - row: physicalRow, - col: physicalColumn, + row: physicalRow === null ? row : physicalRow, + col: physicalColumn === null ? column : physicalColumn, sheet: this.sheetId, };