system
1
Hello
I have found 1 thing, which is very annoying. I am not sure, is it bug or not, but anyway I didnt find any solution
So, If to edit text in GameObject with InputField and Text components, putting cursor before last character in text field, then remove all previous symbols (Backspace) and enter new value, the last character (which is positioned after mouse cursor) will hide and reveal only after EndEdit event.
In practice that mean - if we got value 1580 in text field, and we want to change it to 2550, we put cursor between 8 and 0, remove 1 and 5, enter 255, and we see that value in text field is not a 2550, but 255. Of course we adding one more 0, and after finish editing get 25500 instead of 2550…
Does someone know how to fix it?
I found a solution! I have NO idea why this works exactly!
On Value Change for the input field, I add this function referencing the Input Field:
public void FixString(InputField target){
target.lineType = InputField.LineType.MultiLineSubmit;
target.textComponent.SetAllDirty();
target.lineType = InputField.LineType.SingleLine;
}
The last character is left untouched and I can stay in singleline! Weird stuff!
If I change the Line Type of the Input Field to any Mutli Line type, the problem goes away - but I’d like to not have the problem on single lines either…