Skip to content
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

Links don't render correctly when used with flexDirection='row' #269

Open
tknickman opened this issue Mar 31, 2020 · 1 comment
Open

Links don't render correctly when used with flexDirection='row' #269

tknickman opened this issue Mar 31, 2020 · 1 comment

Comments

@tknickman
Copy link

tknickman commented Mar 31, 2020

I am seeing a strange issue when using ink-link (or terminalLink as well) along with the Box provided by ink.

I am trying to make a two column layout with ink, utilizing links in each column.

If I add links to the text as follows:

const LinkBugExample = () => {
  return (
	<Box flexDirection="column">
      <Box>
        <Link url="www.google.com">google</Link>
      </Box>
      <Box>
        <Link url="www.bing.com">bing</Link>
      </Box>
    </Box>  
  );
};

This renders fine:
working

But, if I change to flexDirection row:

const LinkBugExample = () => {
  return (
	<Box flexDirection="row">
      <Box>
        <Link url="www.google.com">google</Link>
      </Box>
      <Box>
        <Link url="www.bing.com">bing</Link>
      </Box>
    </Box>  
  );
};

This does not render correctly:
not-working

I can render two links inlina via:

const LinkBugExample = () => {
  return (
    <Box flexDirection="row">
      <Link url="www.google.com">google</Link>
      <Link url="www.bing.com">bing</Link>
    </Box>
  );
};

not-working

So it seems to be something with how nested row boxes are working (possibly something with the width calculation?).

I'm happy to help, but any ideas on where to start?

I'm using:
[email protected]
[email protected]

And my terminal is iTerm2 Build 3.3.9

@vadimdemedes
Copy link
Owner

Created chalk/slice-ansi#31 for this issue, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants