Search Unity

TextField focus step over next field

Discussion in 'Editor & General Support' started by vladipetrenko, Nov 14, 2018.

  1. vladipetrenko

    vladipetrenko

    Joined:
    Jul 28, 2018
    Posts:
    2
    I create a list of TextFields in Vertical layout. After view in UnityEditor, I use a Tab key to go to the next TextField.
    But my focus go not to the next TextField. The focus goes one over next TextField
    For example: From TextFiel0 focus goes to TextField2 then to Textfield4 and so on.

    Simple source example to test:
    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. public class ExampleWindow : EditorWindow
    4. {
    5.  
    6.     [MenuItem("MyWindows/ExampleWindow")]
    7.     public static void Init()
    8.     {
    9.         GetWindow<ExampleWindow>();
    10.     }
    11.  
    12.     void OnEnable()
    13.     {
    14.     }
    15.  
    16.     void OnGUI()
    17.     {
    18.         GUILayout.BeginVertical();
    19.  
    20.         for (int i = 0; i < 20; i++)
    21.             EditorGUILayout.TextField("Text " + i);
    22.  
    23.         GUILayout.EndVertical();
    24.         Repaint();
    25.     }
    26. }
    I use Unity for Linux Version 2018.2.7f1
    I do something wrong, or it is a bug in Unity?