Long strings wrap outside of parent component
See original GitHub issueA simple example:
<Box flexDirection="row">
<Box flexDirection="column" padding={1}>
Some text goes here.
</Box>
<Box flexDirection="column" flexGrow={1}>
<Box flexGrow={1} padding={1}>
{ipsum}
</Box>
<Box padding={1}>
$ An input box goes here.
</Box>
</Box>
</Box>
…where ipsum
is a text string with several paragraphs worth of text.
The result has each of the paragraphs from ipsum
rendered as starting on the same column, but wrapping at the end of the terminal to the start of the next line, where they should be getting hard-wrapped instead to fit the Box
’s layout.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Wrapping and breaking text - CSS: Cascading Style Sheets
This guide explains the various ways in which overflowing text can be managed in CSS.
Read more >overflow-wrap | CSS-Tricks
overflow-wrap is generally used to avoid problems with long strings causing broken layouts due to text flowing outside a container. word-break ...
Read more >Forcing a long line of text (without spaces) to line break ...
We would like to force this to line break (even mid word) according to the css specified width (width:100px) of the parent container....
Read more >How to wrap text inside and outside box using CSS
In this article, we are going to cover how one can wrap the text inside and outside the box using the CSS properties....
Read more >Out-String (Microsoft.PowerShell.Utility)
Specifies the number of characters in each line of output. Any additional characters are wrapped to the next line or truncated depending on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Rewrote text wrapping to accommodate more use cases and pushed to master. Here’s the docs for a new
textWrap
property - https://github.com/vadimdemedes/ink#wrapping. Note that it’s disabled by default, so theoretically it shouldn’t impact any of existing Ink apps.@zkat @SimenB @maticzav @icopp I would really appreciate it if you could quickly try master branch (
npm install vadimdemedes/ink
) in your Ink apps. I pushed some important changes, which I don’t expect to break anything, but better safe than sorry! Thank you ❤️Implemented
<Box textWrap="wrap">
in master branch here - https://github.com/vadimdemedes/ink/commit/e8e6811935271c83f5fedc412e627ca2fca16248. Will close this issue once it’s released 😉