Author Topic: Bug: UIInput + max lines + enter key  (Read 2359 times)

irrationalistic

  • Guest
Bug: UIInput + max lines + enter key
« on: August 29, 2013, 12:45:35 AM »
I'm new to NGUI, but I'm pretty sure this is a bug and I haven't been able to find any posts that discuss it!

Using the latest version, create a new Input widget. Observing the internal label as maxLines = 1 and having a maxWidth set (mine is 322). The camera's UICamera has "Return" as a valid submit key. I've got a very basic script that just transcribes what's in the input on submit into a secondary label without clearing either. And that's the setup.
  1. void OnSubmit(string text) {
  2.     GetComponent<UILabel>().text = text;
  3. }
  4.  

So how to get it to work. First, typing a short string (like "hi") and hitting enter will work smoothly. It keeps the input as-is and the label gets the proper text. Now, type in a really long string, at least until the textbox start to scroll to keep up. Now hit enter. On my system, the input label actually scrolls down as if anticipating that new line, but it never actually receives it.

Can anybody else get this to happen? Sorry if it's already known!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Bug: UIInput + max lines + enter key
« Reply #1 on: August 29, 2013, 06:16:33 PM »
Might be related to the whole "max lines" being interpreted as label height. I'll look into it.