Search Unity

TextMesh Pro TMP_InputField What is the proper way to select and activate

Discussion in 'UGUI & TextMesh Pro' started by Chris-Trueman, Jan 5, 2020.

  1. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,261
    I'm trying to select and activate an input field.

    I have tried

    Code (CSharp):
    1. input.Select();
    2. input.ActivateInputField();
    and

    Code (CSharp):
    1. input.Select();
    2. input.OnSelect(null);//Gets it to highlight the field.
    3. input.ActivateInputField();
    Both of these do not cause it to allow me to type in the field until I physically click the field.

    Using ver 2.0.1 from the package manager.

    Also a side note, controllers/joysticks have absolutely no effect on InputFields, cancel or submit doesn't work, so how would it work on consoles?
     
    looytroop likes this.
  2. Chris-Trueman

    Chris-Trueman

    Joined:
    Oct 10, 2014
    Posts:
    1,261
    I am activating the InputField too soon apparently. I activate the canvas then activate the InputField. This doesn't work, so I added a delay of 0.01s and it works.

    Is this a bug or intended?