Select index on a text field

With UGUI i could do it like

this.inputField.caretPosition = this.inputField.text.Length;

With UI Toolkit?
The best I could find with a TextField is

this.inputField.SelectRange(this.inputField.text.Length, this.inputField.text.Length);

which /kind/ of works if I don’t click my mouse…

selectIndex is readonly

What you have is the “right” way to do it. What’s the issue if you do click your mouse?

Apologize i should have updated the thread. I figured out the mouse issue was due to clicking in label field which then looked like it got stuck highlighting the text field. Just how I was using this I misinterpreted what was happening.

1 Like