How do I truncate dynamic text which are URLS

Hi all,

I need help in truncating dynamic text in a table. The texts are URLS so there are no spaces in the text. I already tried adding css such as:

#truncate-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}

But that doesn’t do anything. I did also add a fixed heigth etc. to the text but the text just goes invisible.


This is the text I want to truncate, it needs to be limited to 1 line.

Can someone please help me out?

Thanks in advance!

When you set the (max) height and the (max) width for an element, the text will be truncated automatically:

Result:

image

Ps. the width and height of an element can also be limited by using a (max) width and (max) height on the parent element, f.i. a group.

Additionally you can a limit the number of characters using operators:

Result:

image

Yeah so this is only valid when there are spaces in the text. If there are none this won’t do it’s job. I also need the width to be like 25% and not fixed with pixels. This also shows really weird behaviour.

In the editor everything looks fine but once I view it outside the edtitor in my /version-test/ it just makes the text invisible which is really weird.

That is weird indeed and might be a bug, you can report a bug here.

Did you try the 2nd solution in my reply?

That means it needs to be truncated to a set amount of charachters if I’m right? And that is not what I want, I need it to work in a responsive way with a max width of 20% so to say.

This is an annoying (and bizarre) property of the Bubble text element… (if contiguous text is too long to fit in a Text element Bubble just ignores it completely, as if it doesn’t exist, and leaves the text element empty.)

Unfortunately there is no native workaround for this (that I know of).

So whenever I need to truncate Contigous text (such as a long URL), which to be honest is fairly often (this is not an unusual requirement), I just ditch Bubble’s Text element completely and use custom HTML to do it.

That way you can have full control over how it displays.

So that would be my suggestion here.

Happy to hear that I am not the only one struggling with this! Could you maybe help me out in fixing this with the custom HTML you talked about?

This topic was automatically closed after 70 days. New replies are no longer allowed.