InputField Problems on Android

I am using 4.6.1 on Android. I have a couple InputFields on my canvas.

When I tap in them the keyboard comes up and I enter text in the input field that appears above the keyboard. I then tap on another input field and the keyboard goes away. I have to tap it again to get the keyboard to come up.

Now when I enter text in the new field. I tap on a third one and the keyboard goes away. So I tap on the 1st one and the keyboard shows up, but the text in the 2nd and 3rd input fields takes on whatever value is in the 1st one.

The other thing that happens is if I set the check box to hide mobile input these things happen:

Now when I tap on a field the cursor always starts at the beginning even when there is text. If I hit backspace the cursor jumps to the end and the last character is deleted.

The text sometimes disappears when I click on an inputfield

I have the same problem for iOS.

Everything is fine in the editor but when I build an iOS version, the Input Fields on my UI act really weird: all the Input Fields values change to the one i’m editing, InputFields dissapearing and reappearing, etc…

I thought my project was corrupted but to see that somebody else has the problem shows that the new 4.6.1 build might be the problem.

I guess this is good news and bad news. It means the problem is bigger than a small bug and yet big enough maybe Unity will be more motivated to fix it?

What I wonder is if Unity is aware of it. I wonder if they do testing on actual Android and iOS devices. Seems like this would be a pretty big red flag item.

I love what Unity is doing. I know this is Rev 1 of the new UI and it is awesome. Thank you Unity for all the hard work and finally having a first class UI even if it does have a little ways to go in some areas.

I have the exact same problem. Worked fine in 4.6b which I was using for several months. Upgrade to 4.6F2 brought in this non-sense on my Android build. I thought I had corrupted something. Glad to hear I’m not crazy. Sad that it doesn’t seem like there is a good fix.

I love the new UI. But we have to have this right for our production builds. I just sent an email through bugs@unity3d.com to see if we can get some help on this.

I am currently using unity 5, and the inputfield took me a little while to work around, I managed to get one to work for a player name, and allow it to be edited later. Maybe you can use something like this for all of them? My code looks like this (I was searching around the forums for a long time to get to this point) ((another note, for some reason when i click anywhere on the screen i can edit the inputfields text, it activates it, so that may also be a problem))
here is for a brand new player -

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class NewPlayerName : MonoBehaviour 
{
    public InputField PlayerName;
    public Text EnteredName;

    public void UserInput()
    {
        if (Input.GetKeyDown(KeyCode.Return) || PlayerName.text.Length > 0)
        {
            if ((PlayerName.text != null) && (EnteredName != null))
            {
                CreatePlayer(); // This just sets the stats for the new player
                playerName = PlayerName.text; // Sets your players name               
                Save(); //saves the input, and character creation
                Application.LoadLevel("MainMenu"); // then loads the main menu
            }
        }
    }
}

Do note those other functions are called from outside this script and do not directly affect the input. I used the same concept to edit it later…

public void UserInput()
{
    if (Input.GetKeyDown(KeyCode.Return) || PlayerName.text.Length > 0)
    {
        if ((PlayerName.text != null) && (EnteredName != null))
        {
            playerName = PlayerName.text;
            Save();
        }
    }
}

then for the other inputfields you could just copy them and create a new function e.g inputfield2
and make them set different variables. After you have your code sorted out, go to the inputfields inspector and click the “+” symbol in the End Edit (String) box, add the GameObject with the script attatched, then click the arrows in the next drop down and find the UserInput() you would like to use for that inputfield.

Hopefully this helps you if you have not figured this out yet and anybody else who comes along to this question.

This problem still happens on Unity5 for both Android and iOS. Not only appears, dissapears and changes the values of all input fields inappropriately, but also seems to mask the screen so other controls, like buttons, seldom get pressed events.

Let’s face it. It’s not going to be fixed any time soon. If you just need text input, for mobile you could try the Arcade Keyboard asset from the asset store instead. Instead of messing about with the mobile keyboard for input.