-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
component: eventsissue: feature requestDescribes a new feature and why it should be addedDescribes a new feature and why it should be added
Milestone
Description
While trying to save the undostack to make it persistent, I noticed that move event are not serialized correctly, indeed, oldParentId and oldCoordinate are not saved into the JSON, I don't know if it's the expected behaviour, but it seems pretty strange:
It can be reproduced easily, first move a block into the workspace, then run the following code, and undo the last event, it will throw an error (Cannot read property 'nextConnection' of null).
const save = Blockly.mainWorkspace.undoStack_.map(function(event) { return event.toJson(); });
Blockly.mainWorkspace.clearUndo();
Blockly.mainWorkspace.undoStack_ = save.map(function(event) {
return Blockly.Events.fromJson(event, Blockly.mainWorkspace);
}If this is indeed a bug, I could submit the fix I wrote for my app.
ex0ns
Metadata
Metadata
Assignees
Labels
component: eventsissue: feature requestDescribes a new feature and why it should be addedDescribes a new feature and why it should be added