FIXED: Text comp multi line fokus problem

Hey i think i found a small bug, or maybe its a setting i can’t find.
I have the text comp in the attached file set to multi Line because i need the word Wrap in a UI element, i edited the code so the text gets deleted when the text field ist clicked on, but the new test can only be put in in when i click an additional time, although the info chop says taht focus is on.
when i change the format to string it works on the first click, both deleting the text and the ability to enter text.

Thanks in advance for any help :slight_smile:
multi line bug.1.toe (5.7 KB)

Hi @Grandmasterodb,

thanks for this example, I can recreate and we are having a look!

cheers
Markus

Thanks for the example. The issue was a small difference in behaviour between the single and multiline modes for the Text COMP and how they handle invalid cursor positions.

When you click on the text, it usually sets the cursor position in the middle of the word, but when you then clear the text immediately it was leaving the cursor in an invalid position from the old word.

In single line mode it was just automatically correcting the invalid position and inserting the new text from the start, but in multi-line mode it was just failing quietly preventing you from entering text. You can see this if you click the Text COMP on the far left side of the window which would set the cursor at the beginning of the word … it should then allow you to keep typing as you expect.

We’ll include a proper fix for this in our next release, but in the meantime if you add the line comp.setCursorPosUV(0,0) to your onFocus call after where you clear the text it should move the cursor to a valid position and let you keep typing.

image

1 Like

Thanks Markus and rob, this works, im glad i could contribute to make TD work a little better :slight_smile:

1 Like