question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long strings wrap outside of parent component

See original GitHub issue

A 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:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
vadimdemedescommented, Mar 28, 2019

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 ❤️

1reaction
vadimdemedescommented, Mar 27, 2019

Implemented <Box textWrap="wrap"> in master branch here - https://github.com/vadimdemedes/ink/commit/e8e6811935271c83f5fedc412e627ca2fca16248. Will close this issue once it’s released 😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found