2D Toolkit Forum

2D Toolkit => Support => Topic started by: maureli on February 14, 2014, 04:07:11 am

Title: UITextInput Control Strange Behavior
Post by: maureli on February 14, 2014, 04:07:11 am
I created two UITextInput fields for a username and password and somehow, when the password field is selected, the username field is also being updated. Any idea what is going on and how to fix this? Thanks.
Title: Re: UITextInput Control Strange Behavior
Post by: unikronsoftware on February 14, 2014, 09:29:40 am
What version of tk2d are you using? Can you reproduce this in a simple scene and email support?
Title: Re: UITextInput Control Strange Behavior
Post by: maureli on February 17, 2014, 11:00:40 pm
It says 2.3.0; however, I went to import the latest version and it says none of the files are new. I had picked the new files when this error occurred in an attempt to fix it by updating.

I can put together a simple scene soon. Busy meeting a deadline today.
Title: Re: UITextInput Control Strange Behavior
Post by: maureli on March 21, 2014, 02:26:21 pm
As an update, it appears that it was a lack of having a UIManager in the scene as it stopped happening once I placed one in my scene.
Title: Re: UITextInput Control Strange Behavior
Post by: maureli on April 10, 2014, 11:35:00 pm
Another strange thing is occurring. I am not receiving my SendMessageOnTextChangeMethodName message when I type into the UITextInput field on iOS.
Title: Re: UITextInput Control Strange Behavior
Post by: theschnuffel on April 11, 2014, 08:38:33 am
Funny, I had the exact same problem yesterday. The OnTextChange message is received fine in the editor, but nothing happens in iOS.
Title: Re: UITextInput Control Strange Behavior
Post by: theschnuffel on April 11, 2014, 11:44:39 pm
Apparently it's because of this problem: http://answers.unity3d.com/questions/464901/inputinputstring-on-ios-empty-1.html

I patched tk2dUITextInput.cs with this code, inserted around line 289:
Code: [Select]
#if UNITY_IOS && !UNITY_EDITOR
inputStr = keyboard.text;
if(!inputStr.Equals(text)) {
newText = inputStr;
change = true;
}
#endif

Works for me.
Cheers
Title: Re: UITextInput Control Strange Behavior
Post by: maureli on April 12, 2014, 01:49:12 pm
I added that code before the loop around that location and now I get duplicate input for every character typed on iOS.
Title: Re: UITextInput Control Strange Behavior
Post by: theschnuffel on April 12, 2014, 05:01:22 pm
No, you should add it after the loop. Right before
Code: [Select]
if(change) {}
Title: Re: UITextInput Control Strange Behavior
Post by: paulhocker on August 04, 2014, 01:12:47 pm
is this patch going to be added in the next release? i updated my version of 2dtk and was bitten by this bug again.

- Paul
Title: Re: UITextInput Control Strange Behavior
Post by: unikronsoftware on August 05, 2014, 10:43:30 pm
I've put into 2.5, but I bet as soon as thats released, Unity go and fix that original bug ....
Title: Re: UITextInput Control Strange Behavior
Post by: maureli on September 18, 2014, 07:12:38 pm
Android text input is duplicating all input but on device only, not in the editor. Is there a fix for this?
Title: Re: UITextInput Control Strange Behavior
Post by: unikronsoftware on September 19, 2014, 04:24:28 pm
Just tested the latest version - it works fine running on android. What version of tk2d are you testing this on?
Title: Re: UITextInput Control Strange Behavior
Post by: maureli on September 19, 2014, 04:42:28 pm
I am running version 2.4.0. and was running Unity 4.3.
Title: Re: UITextInput Control Strange Behavior
Post by: unikronsoftware on September 19, 2014, 04:54:32 pm
The script hasn't changed in a very very long time, and seems to work fine in my tests. Please post a repro case for this so I can try to reproduce this.