Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

¶ added to input fields

Discussion in 'UGUI & TextMesh Pro' started by StefanAugmentors, Nov 1, 2018.

  1. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
    When ever I input text into TMP_InputField an invisible "¶" gets added at the end.

    Below is the settings on the input field.

    Screenshot_147.png
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Is it because you press 'enter' to finish editing the input field? If you know you'll never want that formatting mark, try trimming it off the string when the input field loses focus, or when you are about to use the string.
    Code (CSharp):
    1. inputField.text = inputField.text.TrimEnd('\r', '\n');
     
  3. StefanAugmentors

    StefanAugmentors

    Joined:
    Nov 3, 2017
    Posts:
    15
    Yes I press enter on the mobile keyboard. I added trim to the string before sending it off to the server. However I'd like to know if there's a setting to stop it adding that formatting mark.