Closed Matergi closed 2 weeks ago
It seems that if I don't include:
undo.initialize(initialData);
the issue doesn't occur, but in this case, performing Ctrl+Z clears everything
Forgive me, it was my mistake, I was initializing EditorJS like this:
onReady: async () => {
...
this.editorJSRef.blocks.render(data);
...
}
but I had also added the data
prop in the EditorJS constructor:
new EditorJS({
...
data
...
})
By removing this.editorJSRef.blocks.render(data);
, everything works fine. Issue closed.
Precheck
Description
When performing an undo (Ctrl+Z) action in a project containing empty paragraphs, an error occurs, seemingly when reaching the end of the undo stack. Writing content works as expected, but when undoing multiple actions, the error appears, likely triggered when all changes have been undone and the stack is exhausted. Subsequent undo actions function normally after the initial error.
https://github.com/user-attachments/assets/b5f24f82-3c94-4b99-b977-9acb350892ae
config
initialData
plugins:
Environment
Current behavior
(Ctrl+Z) at the end of the stack
Expected behavior
A clear and concise description of what you expected to happen.
Additional context
Add any other context about the problem here.