Text not wrapping correctly

I have a new issue which I have encountered. For a text box that where the text is not defined by code, the text will wrap properly:

This is an example of text
wrapping properly.

But when I define the text as follows:
$w(‘#textbox’).text = data.subscribetitle1;

The text box will no longer wrap properly, but will instead break up words, e.g.

This is an example of te
xt not wrapping properly

Am I missing something in my coding or some other setting?

Hi,

What happens if you expand the width of the text element? Does it fix the issue?

It may also be dependent on the data that has been input in the collection field you assigned to data.subscribetitle1.

If it’s from a rich text field in your content collection its most likely generating the content along with it’s formatting so you might want to check that out as well.

Also, you mentioned the issue is with a textbox, did you mean a text element? Cause if it is a textbox then you would assign the value with textBox.value instead of the text property.

Hope this helped!

Best regards,

Good questions. But - it is a simple text field assigned to a simple text element, so that’s not the issue.

Has someone found a fix for this? I have the same issue.