Skip to content

In-progress changes are lost if update arrives while you are typing #7

@link2xt

Description

@link2xt

To reproduce, start typing into a cell on one device. Then type into another cell from another device.

On the first device, the whole state is refreshed and whatever was typed is lost.

It happens when the whole model is recreated here:

calc/src/App.tsx

Lines 97 to 98 in afe3213

const newModel = Model.from_bytes(model.toBytes());
setModel(newModel);

If I comment out these lines then the changes are not lost, but the state is also not refreshed until I move focus somewhere else.

Original application does not recreate the model, but redraws the whole component using setRedrawId hack:
https://github.com/ironcalc/IronCalc/blob/b9b3cb1628616a746fe7c06d41162df739eb79c0/webapp/IronCalc/src/components/Workbook/Workbook.tsx#L40-L42

If I add this setRedrawId to function App() and call it from setUpdateListener instead of recreating the model, there is the same problem, so it is likely a problem in the original app as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions