Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.15f1
2022.1.23f1
2022.2.0f1
2023.1.0a21
Issue ID
UUM-20768
Regression
No
UI Toolkit ListView can cause the layout to overlap when there are children of elements preceding it
How to reproduce:
# Open the attached project "UiTest.zip"
# Enter Play Mode
# Click the "Add Data" button in the Game view
Expected results: Layout does not overlap
Actual results: Layout overlaps
Reproducible with: 2021.3.15f1, 2022.1.23f1, 2022.2.0f1, 2023.1.0a21
Could not test with: 2020.3.42f1 (errors in the Console window)
Reproducible on: Windows 10
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- NullReferenceException when setting 'isTextObjectScaleStatic' to false on a disabled TextMeshPro GameObject
- Shader Stripping Custom Options disappear when exiting Play mode without reloading Domain
- Decals do not get projected when 'Rendering Layer Mask' on a GameObject is 23rd Layer or above due to encoding/decoding issues
- Deriving from SearchContextAttribute doesn't always work
- Scripting API documentation is missing for macOS editor extensions
Resolution Note:
The overlap happens because the visual element containing the label has a computed flex-shrink of 1 and a computed overflow of visible.
The flex-shrink being at 1 means that the element containing the label can shrink. In this case, both the ListView and the element containing the label have flex-shrink set to 1, so after the "initial" space is calculated, both will be shrunk in equal measures to fit the available space.
The overlap happens because the overflow of the element containing the label is set to visible. If you switch it to overflow, you should see that it is not overlapping anymore.
To ensure that the label is always visible, you can set the flex-shrink on the parent to 0, which will ensure that its size will be computed by its children.