Closed ARH3 closed 9 months ago
Hello - just checking in to see if anyone has had a chance to review this? Thank you!
@ARH3 Yes, this seems to happen with instances that set paragraph: false.
We'll let you know when we find a fix, but feel free to create a PR if you come up with a possible solution.
@ARH3 Thanks a lot for reporting the issue. It was solved and the solution is now available in v2.0.24
. As we were testing, the paragraph: false
option is unnecessary to set a default block in the editor. However, if you keep the option, the editorjs-undo
does not fail.
Please let us know if this solution proves helpful to you.
Precheck
Description
I keep getting this error and am having a really hard time figuring out why. It happens very frequently when I use CMD+Z to try and undo something. I am trying to find a pattern of when it happens, but it happens so frequently... for example if I open an existing editorjs json file, add one space somewhere, and then hit CMD+Z, it will throw this error and remove my entire editorjs div from the DOM... it's a very disruptive error.
Error:
I have a custom block as my default, called
song
, and setparagraph: false
because I don't want it. The error points at line 7470 in the undo plugin that hast.editor.blocks.insert("paragraph", {
.This leads me to believe that this plugin might be incompatible with Editorjs instances that set
paragraph: false
and/or set a custom default block? However I'm not certain.Environment
Current behavior
Editorjs crashes when I try to use CMD+Z to undo something. Happens very frequently.
Expected behavior
When I use CMD+Z, I expect the most recent action to be undone without a crash.
Additional context
I am happy to provide any more information that would be helpful to resolve the issue. Thanks!