setDataAtRowProp closing the edition of a cell from a different row

I’m trying to change multiple cells of the same column, one after another, by doing this:

  1. double-clicking a cell to start editing it
  2. typing something
  3. pressing “enter” to save the change and already open the cell below
  4. start typing something to change the newly selected cell

The problem is that I have a afterChange hook that is calling setDataAtRowProp to change a totally different column of the row I changed. Reading its documentation, I thought it would just change the data on a specific cell but it is currently removing the “edit focus” from a completely different cell, even on a different row.

Here is a video of the issue: Zight Recording 2025-07-01 ...
I didn’t click or press any key to close that cell, it got closed because of the setDataAtRowProp call.

Here is a video of the exact same code but without the setDataAtRowProp function call: Zight Recording 2025-07-01 ...

Is there a way to prevent this from happening? I don’t think that calling setDataAtRowProp should close the “edit” of a totally different cell.

Hi @yogodoshi

It’s Aleksandra here. In case you did not get my reply to the email let me paste the reply here as well.

Handsontable has to rerender to show the value in the cell. That is why the editor is closed. You can, however, add additional logic to check if the cell editor is open. Would that help? You could postpone the programmatic change for setDataAtRowProp⁠⁠⁠⁠⁠⁠⁠ till the user closes their cell editor.

Here is the demo Handsontable example - JSFiddle - Code Playground. We can call the hot.getActiveEditor().isOpened() to check the editor state.

Postponing the change done with setDataAtRowProp⁠⁠⁠⁠⁠⁠⁠ wouldn’t be a good solution, because we would be showing outdated data for a while in some cases.

Because every time the user changes 1 cell, we want to update some others that are auto-calculated based on the changed value, for example. So while we are postponing (while the user is keeping the “editor” open) the auto-calculated amounts being shown would be wrong.

But if that is the only option, I will try to do that. Thank you.

Yes, at the moment that would be the only option. Unfortunately Handsontable must rerender to show changes in any cell, and that rerender always closes the active editor. There’s no built-in API to update other cells live while the editor stays open.