Rendering Error in Toolbar TextField on Unity6

When using a TextField in the Toolbar on Unity6, a rendering error occurs. I haven’t made any additional style modifications and simply added the TextField and ToolbarSearchField to the Toolbar. However, a rendering bug occurs where the fields are displayed in white.

How did you add these fields to the toolbar?

     var toolbarType = typeof(Editor).Assembly.GetType("UnityEditor.Toolbar");
            var toolbarObj = toolbarType.GetField("get").GetValue(null);
            _toolbarRoot =
                (VisualElement)toolbarType.GetField("m_Root", BindingFlags.Instance | BindingFlags.NonPublic)!.GetValue(
                    toolbarObj);

            _toolbarLeft = _toolbarRoot.Q("ToolbarZoneLeftAlign");

I used the following code to find and add an element to the Toolbar. Although this is not typical Unity usage, my goal is to customize the Unity editor.

Maybe check in the UI Debugger if additional styles are being applied to it.


It was added successfully, and when inspected with the debugger, the background color is identified as a dark color. However, it is actually being rendered as white.

Its hard to say whats going on, you are doing something we don’t support so its likely it could break now or anytime we do an update.
What is the purpose of these fields? If you want a search bar then integrating something into Unity search would be a good alternative. Unity - Manual: Unity Search

he original goal was to create a slider to control the TimeScale, and I was planning to use the Slider from the UI Elements. However, I encountered the following issue with the TextField in the Slider, and as a test, I added the EditorSearchField to the toolbar, but the same issue occurred. So, I am currently testing whether there is an easier way to add UI to the toolbar.

The ultimate goal is to add custom functionalities to the toolbar using UI Builder. However, there are currently too many limitations, and UI Elements aren’t rendering correctly in the toolbar unless I use IMGUI. As a result, the advantages of using UI Elements are diminishing, which is making me reconsider my approach.