State of EditorGUILayout.FloatField?

I am using several EditorGUILayout.FloatField. They always get sorted by their float values. So I need to take care that while a user changes the value, the list order is untouched.
As the value is changed with the mouse, GUIUtility.hotControl can be used to detect that the sorting has to be blocked.
The problem is that I don’t know how to find out, when the user enters a float with the keyboard. How can this be done?

You could keep two copies of the float values (which I would guess are stored in arrays?) You can then compare the old array with the updated array. If the two are different, then the changed item needs to be moved to its correct place in the array. If the edit operation didn’t actually change the value then the array can remain as it is.

Unfortunately that won’t work. Let’s assume we have three elements 1, 2 and 3. Now I am going to edit 2. So I click the field and add another digit 5. Now the value changes to 25, but the field is still beeing edited! So now we have 1, 3, 25 if the sorting is enabled. The problem is, that the second value is still beeing edited.
The behaviour of the GUI is correct, but strange for that case. That’s why I was asking if we may somehow find out, if the field is beeing edited.

Have you tried GUI.SetNextControlName() and GetNameOfFocusedControl()? I’m not sure whether they would solve the problem you describe, but it might be worth looking into (the idea being not to sort the list if any of the float fields currently has focus).

Jesse, I already tried that. One can only find out, if the whole thing consisting of label and float filed is selected. It’s useless if I try to find out wheter the float is currently beeing edited.

EditorGUIUtility.keyboardControl might help here. You can at least detect when the float field loses focus and re-sort the fields after this happens.

Don’t have time to test it at the moment. I remember doing something with that value in the first try, but I was probably not happy as it did not behave exactly as wanted.
If I understand you correctly, it would definitly be the best available solution.
Thanks a lot!