Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

TextMesh Pro TMP_InputField OnSubmit hidden in custom editor

Discussion in 'UGUI & TextMesh Pro' started by AndyWithaP, Aug 4, 2022.

  1. AndyWithaP

    AndyWithaP

    Joined:
    Sep 17, 2021
    Posts:
    3
    Is there any particular reason why the 'onSubmit' event is not included in the TMP_InputFieldEditor? If it's for clutter reasons, surely you can just stick all the events into a Foldout like the other settings?

    I would have thought having easy access to the onSubmit event would be generally desirable for an Input field.

    Haven't done it yet, but it does look like I can easily add an event listener through the exposed property in code, so shouldn't be an issue, just a mild inconvenience / detracts from an in-editor work-flow.

    PS. also seems like 'Line Type' = 'Multi Line Submit' still adds a carriage return to the input field after the submit event? Maybe happens somewhere like late update, because I had to yield to next frame to clear the text.

    Code (CSharp):
    1. private IEnumerator ClearInput()
    2.     {
    3.         yield return new WaitForEndOfFrame();
    4.         chatInput.text = null;
    5.     }