With EditorJS, saving block, and restoring: always one empty block at the top of area;

484 views Asked by At
  • I input text in editorjs area, and save it when it changes. For exemple, I input one word, and get one block.

  • To restore it later, I first clear blocks, and then add each block:

    myEditor.blocks.clear();
    for (let block of notes.blocks) {
    myEditor.blocks.insert(block.type, block.data);
    }

And each time there is an empty line at the beginning of editor area. Why ? Best regards

1

There are 1 answers

0
mazmax On

Try to add this defaultBlock: "embed", to the configuration of EditorJS