Author Topic: Focus between multiple UIInputs  (Read 3171 times)

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Focus between multiple UIInputs
« on: June 25, 2014, 04:13:07 AM »
Hey, I have two input fields both normal text, no password and hidden input is activated. When I tapping between them on IOS the onscreen keyboard fades in and out, but most of the time, the keyboard is somewhere between... so it happens that its visible but none of the input fields has a focus. it was not like this around 3.6.3ish... please let me know if there are any fixes planed.

thanks carsten

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Focus between multiple UIInputs
« Reply #1 on: June 25, 2014, 07:38:14 AM »
Hmm... try changing "mKeyboard" to be a non-static member in UIInput.cs, line 179. Does that resolve the issue? If not, try to change line 489 from
  1. if (label != null && NGUITools.GetActive(this)) mSelectMe = Time.frameCount;
to
  1. if (label != null && NGUITools.GetActive(this)) mSelectMe = Time.frameCount + 1;
and line 540 from
  1. if (mSelectMe != -1 && mSelectMe != Time.frameCount)
to
  1. if (mSelectMe != -1 && mSelectMe < Time.frameCount)

peterworth

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: Focus between multiple UIInputs
« Reply #2 on: July 02, 2014, 06:13:17 AM »
Hi, i have a similar problem. I have multiple UIInputs on the screen, and then on iPhone:

- i touch one of the UIInputs and edit the text (works fine)
- then touch the next UIInput (without pressing "done" first), keyboard goes away momentarily then comes back as you would expect, but now nothing has focus, entering text in the keyboard doesn't do anything to the UIInput.

None of the fixes suggested above made a difference. Is there anything else i can try? Must be quite a common problem for input form kind of situations

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Focus between multiple UIInputs
« Reply #3 on: July 03, 2014, 03:46:08 AM »
Are you on 3.6.6? I made quite a few changes to the input class.