I need to both select my InputField AND place the caret at the end of that field when a user performs an action. While I can select the InputField just fine, I can’t make the caret display where I want it to. Calling InputField.Select() or InputField.ActivateInputField() selects all text, but then none of the selection or caret position properties seem to do anything.
Here is my code:
this.search.inputFieldSearch.ActivateInputField();
this.search.inputFieldSearch.selectionAnchorPosition = this.search.inputFieldSearch.text.Length-1;
this.search.inputFieldSearch.selectionFocusPosition = this.search.inputFieldSearch.text.Length-1;
this.search.inputFieldSearch.caretPosition = this.search.inputFieldSearch.text.Length-1;
I would expect this to leave the blinking caret at the end of the text in the InputField, but instead it highlights the whole field. Any insight from anyone on this?