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.

Emojis render with trailing spaces within Boxes

See original GitHub issue

Hi there! First time using ink, and I’m really enjoying it so far, but I’ve run into a snag for my project.

I’m making a small terminal-based board game and want to display emojis inside Box elements, but as the title says, every time I render a Box containing a Text element with emojis inside, any row containing emoji gets one space appended per emoji, breaking the right side of the box, which is otherwise appropriately-sized for its content.

The extra spaces do not seem to appear when emojis are printed in a Text element outside of a Box.

Example code:

const Board = () => {
  return (
    <Box flexDirection='column' alignItems='flex-start'>
      <Box borderStyle='round'>
        <Text>🌊</Text>
      </Box>
      <Box borderStyle='round'>
        <Text>🌊🌊</Text>
      </Box>
      <Box borderStyle='round'>
        <Text>🌊🌊🌊</Text>
      </Box>
    </Box>
  )
};

Example output: Screenshot_20200908_084036

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
quinnvokercommented, Mar 21, 2022

@goldbergyoni The explanation is provided by the close message: it was closed because PR #444 resolved the issue and was merged.

1reaction
goldbergyonicommented, Mar 22, 2022

@vadimdemedes Why are you closing these line of issues without any explanation?

Edit: my bad, watched this using mobile and it looked like ‘close’ message without related PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

Emoji rendered in Chrome have different widths than in other ...
It seems like the width of emojis as rendered in Chrome is less than the actual character width.
Read more >
Extra spacing after emoji variants · Issue #1978 · kovidgoyal/kitty
The reason you're seing extra spaces after the sun emojis is that the output actually contains extra spaces. This is probably done because...
Read more >
Why do emojis sometimes come up as blank squares? - Quora
Any character for which your system does not have the font to render, or which is not defined in the document character set,...
Read more >
font-variant-emoji - CSS: Cascading Style Sheets | MDN
This example shows how you can render an emoji in its text or emoji presentation. HTML.
Read more >
Chrome visual bug: Emoji next to text (no space displayed)
I think it's when the emoji is cached that we lose the space. And it's not as much losing the space, but Chrome...
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