Alex-D / Trumbowyg

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

Long text doesn't wrap but widens the editor #365

Closed Duncank closed 8 years ago

Duncank commented 8 years ago

When you type long text in an editor, for example holding down a key until it fills a couple of lines of text, at first the text will wrap correctly to the next line. But when you toggle the HTML-mode on and off, you'll see the editor window expands to fit all of the text on a single line.

Usually that won't happen a lot, but when the editor is re-opened with saved data from before already in it, it opens with all that text on a single line as well. This will happen for example with long Google Drive links.

The part in blue is the highlighted element in Chrome's developer tools. It shows the size the editor should be, but as you can see it is wider and goes on beneath the other editor next to it. If the text is long enough, I can even see it go off screen on the right.

Edit Autogrow is not enabled.

trumbowyg-wrap

Browser: Chrome 54 OS: Windows 10

Alex-D commented 8 years ago

That's a WYSIWYG: if it's broken in the editor, it's broken in your website.

You should add something like word-wrap:break-word;

Duncank commented 8 years ago

I'm sorry, but I don't get your answer. If my trumbowyg editor is set to have a width of 500 pixels and I type or paste a very long string (not with seperate words, so like a link) it wraps correctly, but if I load the editor with that string already as it's value, trumbowyg does not wrap but becomes wider. I think this is a bug, right?

Alex-D commented 8 years ago

Maybe it's a bug, but if it is, it is a CSS bug, so it's not on my end. Maybe your backend change something or your CSS is different or something.

I can't help you more than that, because it's contextual, not generic.