codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.78k stars 2.09k forks source link

Unable to create focusable blocks without initial text inputs #994

Open ralphschindler opened 4 years ago

ralphschindler commented 4 years ago

Hello!

I would like to be able to create a rich block (with selections, etc) that is capable of being inserted into the block list, but also be able to accept a focus onto something (a button, href, or just keep focus on the block without a caret).

Right now, if a block is inserted without a text input, it immediately creates a paragraph block following it.

2019-12-10-09-28-19
theevilhead commented 4 years ago

Is the parent of those three elements (href, buttons) contentEditable? If not make it contentEditable and if you want to enable multilines on the press of enter, In your plugin you will have to add a getter

static get enableLineBreaks() {
    return true;
  }