Author Topic: Bugs with Inputfields  (Read 9055 times)

col000r

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 43
  • Mighty Emperor of Planet "Home Office"
    • View Profile
    • BLACKISH
Bugs with Inputfields
« on: June 04, 2012, 12:12:47 PM »
Hey, I ran into 2 issues with Inputfields:

1) On iOS if I leave an Inputfield by taping on a second Inputfield, the "|" isn't removed from the string.

2) When I submit an Inputfield by pressing Enter and calling a function, I still have the "|" in the string unless I wait a frame before accessing the label.text

Or am I doing it wrong? I'm accessing the text of the labels of the Inputfields...
Games: BLACKISH | Blog | Assets

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bugs with Inputfields
« Reply #1 on: June 04, 2012, 02:59:17 PM »
Which version of NGUI?

col000r

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 43
  • Mighty Emperor of Planet "Home Office"
    • View Profile
    • BLACKISH
Re: Bugs with Inputfields
« Reply #2 on: June 05, 2012, 08:11:11 AM »
2.0.7c
Games: BLACKISH | Blog | Assets

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bugs with Inputfields
« Reply #3 on: June 05, 2012, 01:45:44 PM »
And this only occurs on iOS?

col000r

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 43
  • Mighty Emperor of Planet "Home Office"
    • View Profile
    • BLACKISH
Re: Bugs with Inputfields
« Reply #4 on: June 06, 2012, 07:06:42 AM »
Issue #1: only on iOS. If I leave a field by touching another field, the cursor is not being removed. ONLY if I leave a field by pressing the Done-button on the iOS keyboard the cursor disappears.
Issue #2: In the Editor, but as I said - it can be circumvented by waiting 1 frame
NEW Issue #3: Just found this: On iOS if I touch a password field nothing really happens. The default text ***** are still there even though they should be gone, nothing happens when I hit backspace, only once I start typing the *****s disappear and new *s appear with the cursor behind them.
NEW Issue #4: On iOS if I touch any field the cursor does not appear until I start typing
Games: BLACKISH | Blog | Assets

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bugs with Inputfields
« Reply #5 on: June 06, 2012, 02:42:45 PM »
Sounds like there is something very strange happening with the order of events on iOS. I can't test it here, unfortunately (I've always relied on other testing mobile-related changes). You might need to debug them...

col000r

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 3
  • Posts: 43
  • Mighty Emperor of Planet "Home Office"
    • View Profile
    • BLACKISH
Re: Bugs with Inputfields
« Reply #6 on: June 12, 2012, 02:42:17 AM »
Alright... A few things I found to make the iOS version work better (All regarding the UIInput script)

1) Problem: UpdateLabel() is not called in OnSelect() on iOS when you activate an Inputfield, resulting in the default text still being displayed on the label even though mText is actually empty.
Fix: Just move UpdateLabel() 2 lines down, outside the else condition, so it will be called on iOS also.

2) Problem: Carat char didn't get removed when leaving the Inputfield by tapping on another Inputfield on iOS. Default text didn't get put back when leaving an empty Inputfield.
Fix: In OnSelect, move the iOS/Android if(mKeyboard != null) check into the else of isSelected. Without that change the iOS check would catch on and the rest would never happen. With the change it'll set the software keyboard to inactive and then remove the carat char and put the default text back up, etc.
Games: BLACKISH | Blog | Assets

PhilipC

  • Guest
Re: Bugs with Inputfields
« Reply #7 on: June 12, 2012, 08:40:41 AM »
Those seem like VERY good changes and have been committed to the master repo. So if you have a pro license you can grab the update or wait for 2.09

THANKS!