-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap content if it exceeds the editor width #2679
base: next
Are you sure you want to change the base?
Conversation
@neSpecc Sorry for the ping, but is there anything I can do to get this over the line? Would you like me to create an issue first? Seems like a pretty straightforward fix to me 😇 Thanks for your work! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, thank you. Please, add a line to the docs/changelog.md
Awesome, thanks for your super fast response! Added to the changelog now 👍 |
Oh, interesting! Turns out that it's mainly an issue in Firefox. Chrome and Safari seem to apply built-in browser styles that prevent the overflow. However, I guess it doesn't hurt to apply |
Long words can currently exceed the editor area - to be observed especially with rather small areas.
Instead, the content should always be wrapped at the end of the line (as it behaves in a native text field).
This can easily be achieved with
word-break: break-word
1 applied to all "contenteditable" elements.With this, paragraph wrapping will still behave the same (see "Lorem Ipsum" example below) and, for example, content in tables becomes cleaner and better aligned automatically.
Some plugins appear to have recognized this issue and are addressing it individually at the moment, for example
@editorjs/nested-list
2.However, this is something that should be addressed in core by default for all block tools.
Would also fix editor-js/paragraph#57 (external).
Repro
With repo demo (
yarn dev
), in "thin mode".JSON
Before
After
Footnotes
https://developer.mozilla.org/en-US/docs/Web/CSS/word-break ↩
https://github.com/editor-js/nested-list/blob/95b37462dc93c19b83f0481f509034a40d436cf2/styles/index.pcss#L27 ↩