Search Unity

Question TMP_InputField Loses Focus After Submitting Input

Discussion in 'UGUI & TextMesh Pro' started by aarushban, Jan 12, 2023.

  1. aarushban

    aarushban

    Joined:
    Dec 26, 2017
    Posts:
    2
    Hi everyone,

    Realized I posted this in the wrong forum, so just copying it over:

    Hope you are doing well! It's my first time posting here, but thought I should post here to see what might be going on. So it seems that when I type something out in my TMP_InputField and hit enter, the input bar loses focus, and I have to click on it again in order to type.

    I was wondering if there was a way to autofocus on the TMP_InputField after hitting enter. Is there a setting that I might need to change?

    Seems like there are solutions for the regular InputField components, but strangely enough, none of them have been translating to TMP_InputFields.

    I tried doing it through script using

    searchText.ActivateInputField()


    (where searchText is of type TMP_InputField)

    but it seems that I am getting a "The type or namespace name 'Selectable' could not be found"

    I also double-checked that an EventSystem was present in my scene.

    Any help is appreciated, thank you!