Search Issue Tracker
By Design
Votes
0
Found in
2021.3.35f1
2022.3.19f1
2023.2.9f1
2023.3.0b6
Issue ID
UUM-63217
Regression
No
Random amount of elements are added to the ListView when pressing the + button if having a custom ListView
How to reproduce:
1. Open the user’s attached “BugReport.zip” project
2. In the Hierarchy window, select “Test01” GameObject
3. In the Inspector window, press the + button in the “Bug Report 01” Component
4. Observe the list
Expected result: 2 elements are in the list
Actual result: 3 elements are in the list
Reproducible with: 2021.3.35f1, 2022.3.19f1, 2023.2.9f1, 2023.3.0b6
Reproduced on: macOS 14.2.1 (Intel)
Not reproducible on: No other environment tested
Notes:
- not reproducible after deselecting and selecting “Test01” GameObject
- the same issue happens when entering a number in the value field
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
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
The problem lies in the provided project's code. They use bindItem to add the content instead of only binding existing elements. They should be using makeItem for element creation, and bindItem to assign values. BindItem is called multiple times as items are virtualized by the ListView, so adding elements there is not recommended, or should be reverted by a unbindItem or covered by null checks.
For more information, see https://docs.unity3d.com/Manual/UIE-ListView-TreeView.html