Sorry to necro, but I have the exact same issue for the same use case, and none of the above worked for me in 3.9.9.
I need both: when the user clicks or hits a shortcut, the whole text must be selected.
But, in some cases, I want to focus the input and append text to it without selecting the text.
I tried this:
bool temp = input.selectAllTextOnFocus;
input.selectAllTextOnFocus = false;
input.isSelected = true;
input.value = text;
input.selectAllTextOnFocus = temp;
But it doesn't works.
Actually I found that the text gets selected one frame after, from the Update() callback in UIInput (only place selectAllTextOnFocus is used), making it needlessly hard to temporarily disable it when setting a text prefix