editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

An empty block is added in readOnly mode on top

Open bettysteger opened this issue 1 year ago • 3 comments

After the update to 2.29.0 in readonly mode there is a empty block added with an invisible (opacity: 0) placeholder text. The empty line is breaking the layout.

I temporarily fixed it with CSS:

.ce-paragraph[data-placeholder][contenteditable="false"]:empty {
  display: none;
}

Expected behavior: No additional line on top should be rendered, like in v2.28.0 in readOnly mode.

Screenshots: image

Device, Browser, OS: Macbook, Chrome, MacOS

Editor.js version: 2.29.0

bettysteger avatar Feb 12 '24 17:02 bettysteger

Thanks, @bettysteger , would you try to research that?

neSpecc avatar Feb 12 '24 17:02 neSpecc

It seems to only appears if you initiate editorjs with readOnly: true, if you toggle to edit and then back to readonly, or if you initiate with readOnly: false and toggle it, the empty blocks does not come back.

conradfr avatar Jun 11 '24 16:06 conradfr

I temporarily fixed it via CSS:

// need this fix since update of editor.js to 2.29.0
// @see https://github.com/codex-team/editor.js/issues/2613
.codex-editor__redactor > .ce-block:first-child .ce-paragraph[data-placeholder][contenteditable="false"]:empty {
  display: none;
}

bettysteger avatar Jun 11 '24 17:06 bettysteger