Hello Guest

Author Topic: UITextInput Control Strange Behavior  (Read 9903 times)

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
UITextInput Control Strange Behavior
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #1 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?

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #2 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.

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #3 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.

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #4 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.

theschnuffel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #5 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.

theschnuffel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #6 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
« Last Edit: April 11, 2014, 11:53:50 pm by theschnuffel »

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #7 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.

theschnuffel

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #8 on: April 12, 2014, 05:01:22 pm »
No, you should add it after the loop. Right before
Code: [Select]
if(change) {}

paulhocker

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 22
    • View Profile
    • SpockerDotNet LLC
Re: UITextInput Control Strange Behavior
« Reply #9 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #10 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 ....

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #11 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #12 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?

maureli

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #13 on: September 19, 2014, 04:42:28 pm »
I am running version 2.4.0. and was running Unity 4.3.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: UITextInput Control Strange Behavior
« Reply #14 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.