Search Issue Tracker

Active

Under Consideration for 6000.0.X, 6000.1.X

Votes

0

Found in

6000.0.30f1

6000.1.0a7

Issue ID

UUM-90249

Regression

Yes

Dropdown UI elements have their Content misplaced when nested inside a Prefab containing a root object with a Canvas Component

--

-

How to reproduce:
1. Create an empty project
2. Create a new Prefab inside the Asset folder and open it
3. In the Hierarchy window, find the root gameObject that has been created inside the Prefab (should have the exact name as the Prefab) and select it
4. In the Inspector window, add the Canvas Component to the gameObject
5. Ensure that Render Mode is set to “Screen Space - Overlay”
6. Add a blank UI Panel as the child object to the root gameObject (Right-click the root object > UI > “Panel”)
7. Add a “Dropdown - TextMeshPro” to the Panel (Right click the Panel > UI > “Dropdown - TextMeshPro” )
8. Expand the Dropdown element in the Hierarchy
9. Set the “Template” gameObject of the Dropdown to “active” in the Inspector window
10. Navigate to “Viewport > Content > Item” in the Hierarchy and select the Item
11. Observe the Scene window

Expected result: Dropdown Items are created inside the confines of the Template
Actual result: Dropdown Items are created in the lower left corner below the Panel

Reproducible in: 2023.2.0a14 , 6000.0.30f1, 6000.1.0a7
Not reproducible in: 2021.3.46f1, 2022.3.54f1, 2023.2.0a13

Reproducible on: macOS 14.6.1 (M1 Pro), Windows 11
Not reproducible on: No other environments tested

Workaround: Using a separate Canvas gameObject instead of a Canvas Component before nesting the Panel and Dropdown so that the flow would be “Prefab root object > Canvas > Panel > Dropdown”

Notes:

* Also reproducible in Player
* Not reproducible in Unity versions that don’t have TextMeshPro integrated into Core
* Not reproducible using any tested TextMeshPro package versions in 2022.3.x and 2021.3.x
* Not reproducible using “Dropdown (Legacy)” UI objects
* To observe this issue, it's best to toggle "Visualize" under the Navigation section in the Inspector window for the Item object of the Dropdown (Dropdown > Template > Viewport > Content > Item > Toggle component (Inspector window) > Navigation (Inspector window) > Visualize (Inspector Window))
* Some Editor versions may still prompt to "Import TMP Essentials" when testing. For the issue to be observable, TMP Essentials have to be imported into the project.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.