Search Issue Tracker

By Design

Votes

0

Found in

2017.3.0b7

Issue ID

963890

Regression

No

Text Mesh Pro Input Caret resets to wrong position

uGUI

-

The TextMesh Pro InputField caret resets to the wrong position with specific settings on the text viewport's pivot.

To reproduce:
1. Download attached project + Open Main Scene
2. Enter Play mode
3. Deselect + reselect both text field's

Notice how the alignment of the caret fails on the second text field.

Seems to be being cause by the object 'InputField_NotWorking' having its pivot set to (0.5, 1.0). Setting the pivot to (0.5, 0.5) makes it work correctly.

Comments (1)

  1. NickMcCo

    Apr 04, 2018 00:21

    I am still having this issue, maybe I'm using an old version of textmeshpro or something. Anyway, for future googlers, this is how I solved the problem:

    UsernameField.onSelect.AddListener(i => {
    var rect = UsernameField.GetComponentInChildren<TMP_SelectionCaret>().rectTransform;
    rect.anchoredPosition =
    new Vector2(-(rect.rect.width/2), rect.anchoredPosition.y);
    });

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.