Search Unity

InputField and Multi Line

Discussion in 'UGUI & TextMesh Pro' started by heemun, Oct 3, 2014.

  1. heemun

    heemun

    Joined:
    Apr 15, 2014
    Posts:
    18
    Hello, i have a problem with InputField.

    If Multi Line property is turned off everything works fine, when i press Enter Submit event is occured.

    But if Multi Line is turned Enter key doesn't launch Submit Event.

    How can i use enter key only for sumbit and keep Muli Line on?
     
  2. heemun

    heemun

    Joined:
    Apr 15, 2014
    Posts:
    18
    no ideas?
     
  3. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    I would submit a bug report
     
  4. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    currently multiline treats enter presses and new line where single line does submit. to submit on multiline its shift enter (99% sure of that)
     
  5. heemun

    heemun

    Joined:
    Apr 15, 2014
    Posts:
    18
    shift+enter doesn't work for me
     
  6. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    Unfortunately that is not the case, Enter does not add a new line, only Shift+Enter does. I reported a bug about it earlier. I think most users expect Enter to add a new line in a multiline input field.
     
  7. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    this has changed today. you now specify what you want to happen when return is pressed.
     
    mh114 likes this.
  8. BonyYousuf

    BonyYousuf

    Joined:
    Aug 22, 2013
    Posts:
    110
    I am stumbled on this issue as well. I could not make "OnSubmit" to work when multiline is checked. Enter, S***+Enter, Ctrl+Enter all adds new line, nothing triggers OnSubmit event.
     
  9. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    With beta 21, return now can add newlines (yay!). Unfortunately it seems that scrolling the input field is now broken, text gets added but the its not visible until the rows above are deleted. Also the long-awaited OnValueChange event does not work when text is removed with backspace or delete, making it quite useless.
     
  10. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Sounds like you have two bugs to report now :)
     
  11. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    Indeed, going to do just that. Trying with new project I could not reproduce the broken scrolling, so I'll have to check back what might be the issue on the real project. OnValueChange() is actually broken, I will submit a bug (done, it's 641530).
     
    Last edited: Oct 21, 2014
  12. jfarias

    jfarias

    Joined:
    Apr 8, 2014
    Posts:
    53
    OnValueChange was already fixed. See this thread.