Skip to content

Fix duplicate TextArea labels in Unity 6 inspectors - #108

Merged
mackysoft merged 1 commit into
mainfrom
fix/issue-105-textarea-label
Oct 15, 2026
Merged

mackysoft merged 1 commit into
mainfrom
fix/issue-105-textarea-label

Conversation

@mackysoft

@mackysoft mackysoft commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix duplicate TextArea labels when the TextArea is the last field drawn by SubclassSelector in Unity 6. Unity's IMGUI TextArea defers its prefix label during Layout; requesting a passive control ID after child drawing resolves that label inside its original IMGUI context.

Scope

  • Apply the workaround at the shared boundary after expanded child drawing, covering normal children, nested fields, and custom drawers.
  • Keep the change in the Editor drawer under UNITY_6000_0_OR_NEWER.

Verification

  • Reproduced in the reported Unity 6000.3.12f1 on macOS using package 1.7.0 and pre-fix main (7c81c92). Compared TextArea last versus a following number field, standard inline fields, and managed references without SubclassSelector.
  • Confirmed one label after the fix for lists, direct managed-reference fields, nested fields, and custom drawers. Entered eight lines, scrolled the TextArea, collapsed/reopened the field, and selected another type through the popup with the entered text retained.
  • Independent static review: no actionable findings.
  • Linux Unity CLI validation: Unity 2021.3.45f2 22/22 passed, Unity 2023.2.22f1 25/25 passed, final Verification passed. The Unity 6 visual regression was checked directly in the Editor.

References

Closes #105

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.
@mackysoft
mackysoft merged commit a746389 into main Oct 15, 2026
8 checks passed
@mackysoft
mackysoft deleted the fix/issue-105-textarea-label branch October 15, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] TextArea field shows duplicate label when used with SerializeReference

1 participant