Input Field shows text as hilighted - make it stop

I have an input field which I activate when it is time for the user to start typing. I want them to type in newlines so I set it to mutli-line with new lines. Then I put a FINISHED button which takes the text, stores it, and ends the typing.

At first, I had to click in the input field to start typing, but when I hit FINISHED it worked correctly. I wanted to skip the click in the input field so I set the input field as selected with

EventSystem.current.SetSelectedGameObject(letterInput.gameObject, null);

Then upon hitting FINISHED instead of having everything as typed, all the text that the user types in is hilighted. I don’t want it hilighted. I want it left alone.

So upon hitting FINISHED I tried

EventSystem.current.SetSelectedGameObject(null);

(I also tried setting it to a different object with the same results).

The test is still showing up as hilighted. If I click in the input field, the hilight goes away but that’s also not ideal.

IDEALLY I would like to have the cursor in the input field as happens when call SetSelectedGameObject and then when I click finish the input field would just show the text as it was written rather than hilight it. How do I make that happen?

call MoveTextEnd() after setting it selected.

But it does not work! Is there any other method?

Do you solve this problem now? If yes, please send email dwp9123@qq.com . Thank you very much

Certainly not going to email you, but I have a couple of options.
First option is part of something else I once worked on, and it involved subclassing the inputfield, and in there, I called a coroutine which waited until the end of the frame and then did “MoveTextEnd(false)”. Guess you could also do this through an event, too.
Second option: Get TextMeshPro (free now from the asset store, and sometime soon integrated into Unity), which I’m 99% sure has the ability to turn that off right there as a checkbox :slight_smile: