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

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!

1 Like

Same problem here… anyone there looking into this?

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.

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.

1 Like

Thanks for the explanation, that sort of fix would be ideal! Have you heard back from them on this yet?

Same trouble.
Not solved yet :frowning:
Found this solution, works well for me.

Any update on this?

I’m having the same problem
@Stephan_B Any updates on this?

@Stephan_B Any updates? This is a huge issue for us.

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

1 Like

I implemented the workaround above, but it’s sadly not working with our needs of our project. :confused: