Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

TextMesh Pro Troubles with TMP Input Field...

Discussion in 'UGUI & TextMesh Pro' started by Vancete, Dec 1, 2017.

  1. Vancete

    Vancete

    Joined:
    May 3, 2010
    Posts:
    198
    Hi there,

    I'm having some troubles with it:

    -Using the TMP Input Field, I can access the input text, but not the textInfo properties, I want to get the line count.

    -If I paste a text on it, the On Value Change event fires one time per character the pasted text has, any way to avoid that?

    I got an answer from the developer:

    The Input Field doesn’t have a TextInfo so you would have to access the underlying textInfo of the child text object which for most cases would accurately reflect the content of the Input Field with the exception of password mode. In addition, the child text object will have an extra no width space in it but that should not affect anything other than character count. Let me know if you find anything else in this.

    Getting the child text textInfo is not valid for me, since it gets updated after the OnChange event and then I can't read properly the line count.

    In terms of the On Value Change, this might be the result of how Unity handles the Copy / Paste operation. I will have to look into this one.

    Still looking a solution for this.

    Any suggestion will be appreciated.
     
  2. Keyserjaya99

    Keyserjaya99

    Joined:
    Nov 17, 2016
    Posts:
    10
    Same issue here, also when copy text with more than 1 lines from outside Unity, then paste that text ...

    Example:
    This is one
    This is Two
    This is Three

    Then remove newline from "This Is Three"
    it should be like this
    This is one
    This is TwoThis is Three

    But, what happen is the text was combined
    upload_2019-9-3_14-56-19.png
    It can be solved if we press backspace twice

    1 More....
    Try to press Keyboard key Page Down or Page Up Button (i don't know how to describe it so plz feel free to try :D )

    Here's my TMP_InputField Settings (which is the same TMP_InputField with the bug Text Combined):
    upload_2019-9-3_14-59-37.png
    upload_2019-9-3_15-1-14.png

    TMP version: 1.4.1
    Any solution will be appreciated ^_^