Remove space at end of text line when right aligned?

I’m trying to use dynamic text that is right aligned, or center aligned, but there is often a space in the text that ends up being the last character in the line. Does anyone have any good ideas of how to remove that space when it ends up being the last character in a line of text?

Edit: accidentally wrote Left aligned.

Hmm. There’s probably some regex pattern you can use. I just don’t know it :upside_down_face:

Yeah. It seems to be an issue with the Right-Align setting on Bubble. The dynamic text works fine when used in an HTML element.

Yeah, that’s due to Bubble using pre-wrap for the white-space CSS property within Text elements, which basically tells the browser to preserve all spaces.

Simply changing the value of the white-space property to something like normal(or even inherit or initial) should “fix” it. I’m pretty sure this is intended behavior though, so I wouldn’t expect Bubble to change it, as it does actually come in handy at times to have spaces preserved (and I suspect there are lots of apps relying on this behavior).

Having said all that, you might try simply adding a space to the end of the text. That should “push” the last line of the text to the left. And if you really wanted, you could even assign a small negative right margin to the Text element to “pull” it to the right a smidge so that it appears flush with the button.

Good luck! :slightly_smiling_face:

I like the idea of keeping it simple by adding a space to the end of the text. I’m going to play around a bit with the CSS property to see if I can get that to work.