Author Topic: UIInput delete key stops working containing panel de/reactivated  (Read 9937 times)

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
I've a text entry field in a panel using UIInput. The input works correctly on PC. If I hide this panel using setactive(false), or disabling the gameobject in the Inspector, and then renable it, the input field no longer works correctly. The backspace and delete keys don't work. This is NGUI 3.9.6c.

It also breaks if the field itself is deactivated. Should I be hiding the panel another way?

Edit: Also the return key on Android creates a new line despite setting the input to OnReturnKey - Submit
« Last Edit: July 05, 2016, 03:26:04 PM by Shifty Geezer »

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #1 on: July 05, 2016, 09:12:40 AM »
It seems to be a bug with the object. Turns out delete wasn't working with that field ever, but duplicating the GameObject, the duplicate field worked correctly without changing anything. So for now I've duplicated the feild and deleted the original and it seems to be working.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #2 on: July 05, 2016, 03:19:10 PM »
Something seems to kill the correct functioning of UIInput. The duplicate that was working now doesn't - backspace doesn't work.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #3 on: July 05, 2016, 03:45:36 PM »
On Android, the caret is placed at the beginning of the string on the text entry. Ideally either the carat should be on the end, or the string should be cleared. The latter is probably preferable behaviour and would fit better the PC implementation.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #4 on: July 05, 2016, 07:49:24 PM »
Limit the label's number of lines to 1, an the caret will appear at the end. It's an Android thing.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #5 on: July 06, 2016, 04:17:27 AM »
Okay. What about the PC problem of delete key not working?

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #6 on: July 06, 2016, 08:41:45 AM »
Another bug. Inactive Text colour is always set to Active Text color at runtime.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #7 on: July 11, 2016, 01:08:24 AM »
Delete key not working? Works fine here, so I'd need some repro case to look at.

Text color is set to an active color if you actually have a text value. If the input field's value is empty, the default text is shown (such as "Press Enter to chat"). That's what uses the "inactive" text color.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #8 on: July 11, 2016, 03:11:17 PM »
Haven't got a test case yet, but I've just had the delete affect the previously used UIInput field. That is, two UIInput fields in a panel. Click the first and type. Cllick the second and type. Press delete and characters disappear from the first label.

Shifty Geezer

  • Full Member
  • ***
  • Thank You
  • -Given: 7
  • -Receive: 9
  • Posts: 226
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #9 on: July 18, 2016, 05:39:01 AM »
Aren identified I had inadvertently added a UIInput on GUI. If you add input as a component instead of through the NGUI menu, be sure you use Input and not UIInput. A single extra component is added which is easily missed.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput delete key stops working containing panel de/reactivated
« Reply #10 on: July 20, 2016, 03:09:33 AM »
UIInput is the correct script. UIInputOnGUI is the not correct one. UIInputOnGUI is added dynamically by UIInput when it gains focus in order to avoid having an active OnGUI function unless it's needed.