Truncate characters responsively

Hey fellow Bubblers!

Has anyone been able to truncate a string of words by characters responsively? Right now, Bubble truncates things by words, instead of characters – they don’t even load the whole string when it’s truncated (they automatically truncate it), so I can’t use CSS to manipulate the truncation behavior.

The :truncate operator doesn’t necessarily work, because I want it to truncate responsively (to prevent overflowing), but I don’t want to have a fixed truncate to character #

Any ideas?

Thanks!

This is the only thing that I can think of. Is this what you are looking for potentially? I know it is kind of convoluted, but I have used it before and I think it works pretty well. :blush:

2 Likes

Hmm yeah, I just tried this and it seems like it still truncates by the word vs the character

Edit: Nvm I used a , instead of . :sweat_smile:

Thanks @J805!

1 Like

Screen Recording 2025-01-07 at 11.26.09 AM

Cool, I was going to say, I just did it and it worked. :blush: Glad you got it working.

Preview: https://testapp42wcleandb.bubbleapps.io/version-test/truncate_characters_responsively?debug_mode=true

Editor: testApp42wCleanDB | Bubble Editor

1 Like

Yep! It was me reading the character incorrectly :sweat_smile:

1 Like

Well, either way. Glad you got it working. I had to really dig back to find this solution. I used this back in 2020! :exploding_head:

Teamwork!

1 Like

Yeah 100% bookmarked :joy: I was searching and didn’t find anything – maybe I wasn’t searching the right keywords :sweat_smile:

Yeah. It was really buried and hard to find. Just back in my memory. :blush:

It turns out it’s doable.

Oh interesting! I guess it wasn’t working with CSS because I had it fixed width :sweat_smile: when it was fixed width, it was loading already truncated