Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question TMP_InputField Loses Focus After Submitting Input

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

  1. aarushban


    Dec 26, 2017
    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


    (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!