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

Editor height by default has too much empty space

Open dheerajsarwaiya opened this issue 7 years ago • 13 comments

Editor height is calculated as sum of block heights + 300px of bottomZone. This extra bottomZone of 300 px is huge for use cases such as comment section, or asking users to write small notes or paragraph.

It would be great if we have option to decrease the bottomZone height. Screenshot from 2019-04-13 10-38-33

dheerajsarwaiya avatar Apr 13 '19 17:04 dheerajsarwaiya

Resolved by #719

neSpecc avatar Apr 29 '19 12:04 neSpecc

Wasn't solved, as far as i can see.

image

Even if you reduce the codex-editor content height, an 300px padding-bottom overflows the editor content.

How can i fix this?

arturcesarmelo avatar Nov 24 '19 17:11 arturcesarmelo

minHeight option can't set to 0px. Please fix

this.config.minHeight = this.config.minHeight || 300;

to

this.config.minHeight = this.config.minHeight!==undefined ? this.config.minHeight || 300;

https://github.com/codex-team/editor.js/pull/719/files#diff-e3bf20e89f6b22c16beb3e17fb3c8a60R154

hata6502 avatar Dec 02 '19 08:12 hata6502

@hata6502 you are welcome to fix it and send a PR

neSpecc avatar Dec 02 '19 09:12 neSpecc

Not fixed, still a problem!

image

minHeight set to 30 however it still creates a 300px padding-bottom, this is really annoying. Please resolve

image

Dectom avatar Dec 14 '20 09:12 Dectom

Not fixed, still a problem!

image

minHeight set to 30 however it still creates a 300px padding-bottom, this is really annoying. Please resolve

image

you are using it wrong. There is an unnecessary config wrapper in your code.

neSpecc avatar Dec 14 '20 17:12 neSpecc

How do I use config in my code? I couldn't find any examples anywhere. Please help!

image

khan9920 avatar Dec 26 '20 13:12 khan9920

@khan9920

this.editor = new EditorJS({
  holder: 'editor-js',
  ...,
  minHeight : 0
});

yuya-pascolo avatar Jan 26 '21 07:01 yuya-pascolo

When I set minHeight to 0 it creates block with 300 height and then reduces it to 0 after a second.

andreykorolev avatar Nov 17 '22 06:11 andreykorolev

@andreykorolev

When I set minHeight to 0 it creates block with 300 height and then reduces it to 0 after a second.

I noticed this too. There's a "codex-editor__loader" class with height: 30vh, you'll need to override that

.codex-editor__loader { height: 38px !important; }

This eliminated the resize for me. May need to tweak the value for your use case.

roland83 avatar Nov 22 '22 15:11 roland83

I added both of these and it now works

.codex-editor__loader { height: 38px !important; } .codex-editor__redactor { height: 38px !important; }

bellcoTech avatar Dec 08 '23 00:12 bellcoTech

.ce-block__content, .ce-toolbar__content { max-width: calc(100% - 100px) !important; } .cdx-block { max-width: 100% !important; } .codex-editor__loader { height: 38px !important; } .codex-editor__redactor { padding-bottom: 38px !important; }

nagarjuna-gangadhari avatar Jan 09 '24 08:01 nagarjuna-gangadhari

.ce-block__content, .ce-toolbar__content { max-width: calc(100% - 100px) !important; } .cdx-block { max-width: 100% !important; } .codex-editor__loader { height: 38px !important; } .codex-editor__redactor { padding-bottom: 38px !important; }

this is true code in style css or global styles in the page

mu7ammad1 avatar Mar 28 '24 13:03 mu7ammad1