Troubles with TMP Input Field...

Hi there,

I’m having some troubles with it:

-Using the TMP Input Field, I can access the input text, but not the textInfo properties, I want to get the line count.

-If I paste a text on it, the On Value Change event fires one time per character the pasted text has, any way to avoid that?

I got an answer from the developer:

The Input Field doesn’t have a TextInfo so you would have to access the underlying textInfo of the child text object which for most cases would accurately reflect the content of the Input Field with the exception of password mode. In addition, the child text object will have an extra no width space in it but that should not affect anything other than character count. Let me know if you find anything else in this.

Getting the child text textInfo is not valid for me, since it gets updated after the OnChange event and then I can’t read properly the line count.

In terms of the On Value Change, this might be the result of how Unity handles the Copy / Paste operation. I will have to look into this one.

Still looking a solution for this.

Any suggestion will be appreciated.

Same issue here, also when copy text with more than 1 lines from outside Unity, then paste that text …

Example:
This is one
This is Two
This is Three

Then remove newline from “This Is Three”
it should be like this
This is one
This is TwoThis is Three

But, what happen is the text was combined
4924973--477377--upload_2019-9-3_14-56-19.png
It can be solved if we press backspace twice

1 More…
Try to press Keyboard key Page Down or Page Up Button (i don’t know how to describe it so plz feel free to try :smile: )

Here’s my TMP_InputField Settings (which is the same TMP_InputField with the bug Text Combined):


TMP version: 1.4.1
Any solution will be appreciated :slight_smile: