If the method “GetNameOfFocusedControl” is to be believed, the control named “SearchField” is properly focused.
However, the text field is not editable. If I manually click on the text field, it becomes editable.
Here is a workaround. It seems there is a different method to focus TextFields. Go figure…
GUI.SetNextControlName("SearchField");
string newSearchString = EditorGUILayout.TextField("Search:", _searchString);
GUI.FocusControl("SearchField"); // Kept this one, just in case.
EditorGUI.FocusTextInControl("SearchField"); // Calling a different method for TextField.
I’m not sure if it’s a bug; when using FocusControl (rather than FocusTextInControl), you can use the return key to toggle the focused textfield being editable or not.
Well, I guess it’s a new method. Kinda annoying to see existing method’s behaviour changes without any kind of documentation about it.
BTW, relying on user input to palliate to a broken behaviour is not acceptable in how I code my tools.