Author Topic: UIinput IOS hideinput bug, last character cut  (Read 2840 times)

GingerGene

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
UIinput IOS hideinput bug, last character cut
« on: July 26, 2015, 04:37:09 AM »
Hi Aren and whoever is interested,

First of all let me say that I'm a big fan of NGUI.
I don't like writing in forums so much, but I'v found a small bug that might interest you.
When submitting UIInput on IOS with hide input the last character is cut (was not true on older versions of NGUI, updated to 3.9.0 recently).
Anyway, as I did not find anything about it on the forums, I found the problem and fixed it myself.
Just thought you would want to know (maybe you already fixed it on 3.9.1, but didn't see anything in the change log).
I've added a condition on submit to fix it. It seems to do the trick. I'm attaching the relevant part of the script in case you want to add it to the next update.
Hope it helps.

Yotam Gery
Ginger Gene


---------------------------------------- UIInput.cs line 689 -------------------------------------

if (inputShouldBeHidden)
         {
            if (text != "|")
            {
               if (!string.IsNullOrEmpty(text))
               {
                  Insert(text.Substring(1));
               }
//original line ->                 else DoBackspace();
               else //added this condition to prevent backsapce on submit -> if (!mKeyboard.done && mKeyboard.active)  <- DoBackspace();

               mKeyboard.text = "|";
            }
         }
---------------------------------------- UIInput.cs line 701 -------------------------------------

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIinput IOS hideinput bug, last character cut
« Reply #1 on: July 27, 2015, 08:33:41 PM »
Thanks! I will add your change.