Alex-D / Trumbowyg

A lightweight and amazing WYSIWYG JavaScript editor under 10kB
https://alex-d.github.io/Trumbowyg
MIT License
4k stars 614 forks source link

After upgrading to the most recent version, my trumbowyg editor is now as long as the content #1385

Open jeremytunnell opened 1 year ago

jeremytunnell commented 1 year ago

Everything was solid and then I upgraded, and now the trumbowyg editor expands to the length of the content. For some of my blog posts, the editor is 5000px tall.

I have added: autogrow: false, autogrowOnEnter: false,

Neither of these helps. Problem exists in both Brave and Firefox on Windows.

I have kind if hacky fixed the problem with:

You can see an example of the problem here :

https://jeremytunnell.net/utils/test_tw

Can you recommend how to fix this correctly?

Thanks, Jeremy

Alex-D commented 1 year ago

I have seen this bug, but I have no room to fix it. For now, you can seed a max height. That is what was set before this update.

novotnicek commented 1 year ago

Hello @jeremytunnell @Alex-D

For "solid" height I using this CSS:

.trumbowyg-box,
.trumbowyg-editor,
.trumbowyg-textarea {
    height: 400px;
}

.trumbowyg-box.trumbowyg-fullscreen,
.trumbowyg-box.trumbowyg-fullscreen .trumbowyg-editor,
.trumbowyg-box.trumbowyg-fullscreen .trumbowyg-textarea {
    height: 100%;
}

I don't know, if is really bug :bug: :thinking:. Seems legit for me.

jeremytunnell commented 1 year ago

Thanks @novotnicek. That helps.

It's still a bug though. Default behavior should not be infinite height.

novotnicek commented 1 year ago

Hello @jeremytunnell @Alex-D

I created PR #1418. @Alex-D pls, check it (it's short).

I added height options. Default is 'auto' and don't change current behaviour. Only when user set e.g. height: '300px', then trumbowyg don't "autogrow" with content.

novotnicek commented 1 year ago
$('.someClass textarea').trumbowyg({
    height: '300px',
});