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. Dismiss Notice

TextMesh Pro Pressing Android close keyboard button deletes all text in TMP Input Field

Discussion in 'UGUI & TextMesh Pro' started by BallistiX09, May 20, 2020.

  1. BallistiX09

    BallistiX09

    Joined:
    Mar 29, 2015
    Posts:
    10
    I'm not sure if this is working as intended, but if I have a TMP Input Field and type some text inside on Android, pressing the keyboard hide button will delete all the text from the Input Field.

    This doesn't happen if tapping anywhere on screen to close it, only by using Android's specific on-screen button to hide the keyboard. It sounds like what should happen if the "Reset on Deactivation" checkbox is enabled in the input field settings, but it's definitely disabled in my case.

    Any help or workaround for this would be appreciated!
     
    subhradeepwork likes this.
  2. svbrand

    svbrand

    Joined:
    Mar 29, 2013
    Posts:
    2
    Same problem here... anyone there looking into this?
     
  3. svbrand

    svbrand

    Joined:
    Mar 29, 2013
    Posts:
    2
    We solved it by saving the text while the keyvoard is open and 0.1 second after the keyboard closes, we load the text back into the input field.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    These types of issues are the result of the Android soft keyboard being automatically closed when focus changes. When this occurs, there is a slight delay where the selection of the text gets confused. I have an inquiry to the Android team to see if you can change this behavior to make it possible to prevent the soft keyboard from being automatically closed on focus changes.
     
    MilenaRocha likes this.
  5. BallistiX09

    BallistiX09

    Joined:
    Mar 29, 2015
    Posts:
    10
    Thanks for the explanation, that sort of fix would be ideal! Have you heard back from them on this yet?
     
  6. Luchunpen_0

    Luchunpen_0

    Joined:
    Aug 7, 2014
    Posts:
    58
    Last edited: Feb 3, 2021
  7. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    Any update on this?
     
  8. MilenaRocha

    MilenaRocha

    Joined:
    Jun 30, 2018
    Posts:
    12
    I'm having the same problem
    @Stephan_B Any updates on this?
     
    Last edited: Dec 8, 2021
  9. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    @Stephan_B Any updates? This is a huge issue for us.
     
  10. BallistiX09

    BallistiX09

    Joined:
    Mar 29, 2015
    Posts:
    10
    @MilenaRocha @Nyankoooo It's an absolute joke that this is still an issue nearly two years later, but while we're waiting on Unity actually bothering to organise a fix, the workaround that Luchunpen_0 posted is working fine for me just now.

    It's not ideal obviously, but it's better than the alternative until it's actually fixed!
     
  11. Nyankoooo

    Nyankoooo

    Joined:
    May 21, 2016
    Posts:
    144
    I implemented the workaround above, but it's sadly not working with our needs of our project. :/