From 3e36982d9a68c5023b5c7cdbfa0656117e038dbc Mon Sep 17 00:00:00 2001 From: Makihiro <13536348+mackysoft@users.noreply.github.com> Date: Thu, 15 Oct 2026 18:55:36 +0900 Subject: [PATCH] fix(editor): resolve trailing TextArea labels within the drawer Why Unity 6 can leave a TextArea prefix label pending after Layout, causing it to be drawn again in the next IMGUI context. What Changed Request a passive control ID after drawing expanded managed-reference children, including custom drawers, to resolve pending labels in their original context. Impact TextArea fields render a single label regardless of field order. The workaround is limited to Unity 6 and preserves Unity 2021.3 and 2023.2 rendering. --- .../Editor/SubclassSelectorDrawer.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs b/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs index f1967e6..1a64733 100644 --- a/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs +++ b/Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs @@ -125,6 +125,12 @@ public override void OnGUI (Rect position, SerializedProperty property, GUIConte } } } + +#if UNITY_6000_0_OR_NEWER + // TextArea can defer its prefix label during Layout. Resolve it inside + // this drawer's IMGUI context before UI Toolkit starts another one. + GUIUtility.GetControlID(FocusType.Passive); +#endif } } else