Search Issue Tracker
By Design
By Design in 2023.3.X
Votes
0
Found in
2021.3.25f1
2022.2.20f1
2023.1.0b17
2023.2.0a15
2023.3.0a3
Issue ID
UUM-35888
Regression
No
The last element of an array is not displayed when using a ListView of elements with a custom PropertyDrawer
How to reproduce:
1. Open the attached project "UIToolkit Test.zip"
2. Open Test>Open Dialog ...
Expected results: 3 array elements are displayed in the "DisplayDialog" window
Actual results: "InvalidOperationException: The operation is not possible when moved past all properties (Next returned false)" thrown in the Console window and only 2 array elements are displayed
Reproducible with: 2021.3.25f1, 2022.2.20f1, 2023.1.0b17, 2023.2.0a15
Could not test with: 2020.3.48f1 (compilation 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
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
- Inspector tries to access file after it was deleted when the file was locked in Inspector window
- Changing Transform values in Search window Inspector loses focus while dragging and stopping mouse without releasing dragging action
- Saving changes on the dirty VFX Graph during the Play mode throws "The referenced script (Unknown) on this Behaviour is missing!" warnings
- VFX Graph Debug Info overlaps the "Initialize" block debug info by default
Resolution Note:
The problem lies within the property drawer. A SerializedProperty is already an iterator. Invoking GetEnumerator alters the state of the SerializedProperty, causing it to no longer reference the original property and move on to the next one. To avoid this, it's advisable to create a local copy of the SerializedProperty, leaving the original one unaffected.
Consider implementing the following approach to mitigate the issue:
```Before accessing the iterator, make a local copy of the SerializedProperty using:
property = property.Copy()```
This step ensures that the original SerializedProperty remains unaltered during subsequent operations.
Resolution Note (2023.3.X):
The problem lies within the property drawer. A SerializedProperty is already an iterator. Invoking GetEnumerator alters the state of the SerializedProperty, causing it to no longer reference the original property and move on to the next one. To avoid this, it's advisable to create a local copy of the SerializedProperty, leaving the original one unaffected.
Consider implementing the following approach to mitigate the issue:
```Before accessing the iterator, make a local copy of the SerializedProperty using:
property = property.Copy()```
This step ensures that the original SerializedProperty remains unaltered during subsequent operations.