Text doesn't wrap when "row" is selected as child layout

I’m trying to create two text elements side by side (as children of a surrounding box). The child on the left is a fixed size. The child on the right is supposed to fill the remainder of the width and then wrap.

Wrapping works properly if “columns” or “stack” is selected as the child layout, but not if "row is selected. How do I get wrapping to work properly if layout is “row”?

Example if “row” is selected (i.e. the text wrapping problem):
image

Example if “stack” is selected (i.e. wrapping working properly)
image

Example if “columns” is selected (i.e. another example of wrapping working properly)
image

Howdy @john!

Sounds like a CSS flexbox quirk, but I’m having a bit of trouble reproducing, could you link us to a page this is happening to so we can try it out and find a good CSS fix you can use?

Howdy @steve!

Yes, here’s the builder page: https://builder.io/content/1a972eb2fd5b4ebcae0710baee428f1e

And, here’s the live page: https://thenewpaper.co/jn-dashboard-testing?cachebust=true

You’ll notice another issue, which is that the left boxes should be fixed at 70px (while the right boxes should fill the remainder of space before wrapping), but it looks like there’s another issue in which the left boxes stretch beyond 70px if there’s a small amount of text in the box on the right. Again, this only seems to be an issue when “row” is selected.

Hi, John!

I took a look at your page and couldn’t figure out why wrapping isn’t working properly with the “row” layout. For now, you can give each box in the parent element a percentage width & the text will wrap as expected.

Here’s what it looks like with the left box at 15%, and the right box at 85%:

Screen Shot 2020-04-07 at 3.53.27 PM

I’ll keep playing around with it to see if I can find the core issue.

Hi Maddy – thanks for looking into this!

The issue with using the percentage width (especially for the left box) is that different screen sizes impact its width in different ways (e.g. the date could wrap on small mobile phones or create too much space on large phones).

I found a work around for this.

If you set the width of the right box to calc(100% - 70px) it wraps properly when “row” is selected.

2 Likes

@john @maddy Hi!

This is still an issue, and I don’t understand what is wrong.
As you can see on the right the text overflows the content’s width:

I don’t want to make x% width on my text, it should be wrapped automatically:
Here is the link to my symbol:

Can you please help me out?

Hi @radikris! I don’t see text overflowing on your Builder entry, were you able to resolve this?

on the default entry it is not visible, but for example in this site:

Display: 1000px

And I linked the symbol for you, because there should be fixed the problem

Thanks for those details, I am able to reproduce this in full screen editing mode. I will investigate and keep you updated!

Hi @radikris,

The “customgridmarklistsymbol” layer in Builder takes up full width of the column its in (expected behavior), but the content inside of the symbol is bleeding outside of the container like you mentioned.

I noticed that the content inside of the symbol is set to a width of 50vw, which seems to be causing this to occur. The text is actually is wrapping inside of its parent container, I added a screenshot of this below (I added a background color so you can see the text inside of the box which is overflowing from the page).

If you were to adjust the width of this container, e.g. fit-content, it would look as expected.

But If I add fit-content width:


Then the other symbol which is fullwidth won’t fit the whole div.

I changed vw to %, it is now better, but please check out.

@radikris Yes, it looks better on my end now too!

@maddy it is still not working


How could we fix this overflow issue, the text should wrap without I give them % percentage

Hi @radikris!

To resolve this, you can remove flex-shrink: 0 from the text blocks highlighted in your screenshot above or set the flex-shrink value to 1. Giving an element flex-shrink: 0 will make the element not shrink, it will retain the width it needs/not wrap its content.