Search Unity

TMPro Input Field clear issue

Discussion in 'UGUI & TextMesh Pro' started by Eelcapitan, Mar 21, 2019.

  1. Eelcapitan

    Eelcapitan

    Joined:
    Dec 1, 2015
    Posts:
    5
    I searched for the topic in the forum but I didnt found an satisfying answer to the following question:

    How do I clear an TMPro Input Field?

    I tried somewhat like this:

    Code (CSharp):
    1. public void Clear (){
    2.  
    3.         TMProInputfield1.text = "";
    4.         TMProInputfield2.text = "";
    5.         TMProInputfield3.text = "";
    This works on an "normal" Input Field but not on TMPro Input Field. The field value gets emptied, but the value is still visible, you have to click into the input field again to refresh the input field. This is stupid, because you want to give a feedback to the player immediaely when the Clear() function hits, that he recognizes that the field is really empty.

    I tried also
    Code (CSharp):
    1. TMProInputfield1.ForceLabelUpdate();
    but that doesnt work.

    Had anyone the same issue??