Caret position incorrect for TextInput with TextMeshPro

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
diccon
Posts: 27
Joined: Wed Sep 23, 2020 2:20 pm

Caret position incorrect for TextInput with TextMeshPro

Post by diccon »

Hi,
I've been enjoying using your asset and made great progress but this is driving me nuts - I'm recently converted the Basic Standard Dialogue UI to use TextMeshPro components instead of the regular ones, and its all working great except that the caret on the Input control is not in the right place.

This is the TMP input control:
Image

This is the regular input control:
Image

I am sure this is a problem with the auto layout, but if I turn that off then the label does not resize correctly with the text. Has anyone come across this problem before and found a solution? The only other thing I changed in the prefab was to push the control slightly higher on the screen.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Caret position incorrect for TextInput with TextMeshPro

Post by Tony Li »

Hi,

What version of TextMesh Pro are you using? TMP has had perennial problems with caret placement, unrelated to the Dialogue System. I think the latest preview version available in Package Manager fixes all known caret issues.
diccon
Posts: 27
Joined: Wed Sep 23, 2020 2:20 pm

Re: Caret position incorrect for TextInput with TextMeshPro

Post by diccon »

Thanks for getting back so quickly, we're on TextMeshPro 1.41, unfortunately I don't think I can use the later versions as our project uses Unity 2018. I use TMP input fields elsewhere with no problems but they do not use the auto layout components.
Do you know if there is a version of TextMeshPro that your prefabs were tested with?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Caret position incorrect for TextInput with TextMeshPro

Post by Tony Li »

Hi,

It varies by Unity version. What about getting removing the auto layout components? Most of the prefabs are intended to just be starters that you can customize and change to your liking, so feel free to rip out components, add components, etc.
diccon
Posts: 27
Joined: Wed Sep 23, 2020 2:20 pm

Re: Caret position incorrect for TextInput with TextMeshPro

Post by diccon »

Yes I think I'll implement a custom input control with a slider instead, I'll probably be back soon with more questions...
Post Reply