Wrap content if it exceeds the editor width #2679
Open
+5
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ↩