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
- “Open” button in Inspector does not function for certain Assets
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
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