[GH #1474] Impossible to use table after renaming

Tags: #<Tag:0x00007efc64cbbb98> #<Tag:0x00007efc64cbb940>

Looks like inserting data inside a table after renaming it causes an exception.

I’m using hyperformula.renameSheet().

To reproduce:

Link to sandobox

  1. insert some data in any cell.
  2. click on the rename button.
  3. try to insert some other data and it will fail.

Log:

Expected value of type: SimpleCellAddress | SimpleCellRange for config parameter: address

HyperFormula.isItPossibleToSetCellContents
https://4xthww.csb.app/node_modules/hyperformula/es/HyperFormula.js:250:13
Formulas.syncChangeWithEngine
https://4xthww.csb.app/node_modules/handsontable/plugins/formulas/formulas.js:631:24
eval
https://4xthww.csb.app/node_modules/handsontable/plugins/formulas/formulas.js:872:21
eval
https://4xthww.csb.app/node_modules/handsontable/plugins/formulas/formulas.js:858:17
HyperFormula.batch
https://4xthww.csb.app/node_modules/hyperformula/es/HyperFormula.js:743:7
Formulas.onAfterSetDataAtCell
https://4xthww.csb.app/node_modules/handsontable/plugins/formulas/formulas.js:857:40
Core.eval
https://4xthww.csb.app/node_modules/handsontable/plugins/formulas/formulas.js:237:44
fastCall
https://4xthww.csb.app/node_modules/handsontable/helpers/function.js:314:17
Hooks.run
https://4xthww.csb.app/node_modules/handsontable/pluginHooks.js:2666:47
Core.runHooks
https://4xthww.csb.app/node_modules/handsontable/core.js:4281:48
Core.setDataAtCell
https://4xthww.csb.app/node_modules/handsontable/core.js:1466:14
Object.populateFromArray
https://4xthww.csb.app/node_modules/handsontable/core.js:1046:20
Core.populateFromArray
https://4xthww.csb.app/node_modules/handsontable/core.js:1584:17
TextEditor.saveValue
https://4xthww.csb.app/node_modules/handsontable/editors/baseEditor/baseEditor.js:321:16
TextEditor.finishEditing
https://4xthww.csb.app/node_modules/handsontable/editors/baseEditor/baseEditor.js:408:14
EditorManager.closeEditor
https://4xthww.csb.app/node_modules/handsontable/editorManager.js:344:27
EditorManager.closeEditorAndSaveChanges
https://4xthww.csb.app/node_modules/handsontable/editorManager.js:358:12
callback
https://4xthww.csb.app/node_modules/handsontable/editorManager.js:145:18
eval
https://4xthww.csb.app/node_modules/handsontable/shortcuts/manager.js:123:32
HTMLHtmlElement.onkeydown
https://4xthww.csb.app/node_modules/handsontable/shortcuts/recorder.js:99:32

Hi @nicola

Thank you for reporting this. We investigated it further and it turned that this issue is related to the way Handsontable plugin is storing the sheet name, and the reason why it’s not getting updated after using renameSheet method. We have it reported internally and I’ll update you once it’s fixed.

Meanwhile, you can use this workaround to get it working. It assigns the new sheet name to the Formulas plugin:

hot.getPlugin('Formulas').sheetName = hyperformulaInstance.getSheetName(id);

And here’s working example: https://jsfiddle.net/handsoncode/14qh6g8u/