Search Unity

TextMesh Pro - Input Field - Move text to start on deselect

Discussion in 'UGUI & TextMesh Pro' started by Xaverix, Nov 29, 2020.

  1. Xaverix

    Xaverix

    Joined:
    Mar 21, 2013
    Posts:
    2
    Hi there, I'm trying to get the Input Field to behave like typical input on websites.

    The behaviour I would like to get is that when the input text is long (exceeding the input size), the texts scrolls to the right to show the currently typed text. This is working without the problem. The problem occurs when user clicks outside the input field. On the browser the texts immediatly moves to the beginning, showing the first typed words.

    When I deselect TMP Input Field the texts stays at the end, the same spot I stopped typing. Is there any way to do this properly?

    I tried already calling
    MoveToStartOfLine(false, false);
    using OnDeselect callback, even with one frame coroutine delay, with no luck. The only thing that seems working is changing the textComponent position to zero, but then the Caret becames to behave in a weird way (it's position is not resetting).

    Am I doing something wrong, or there's a bug?

    Unity 2020.1.14f1
    TextMeshPro 3.0.3