Search Issue Tracker
By Design
Votes
0
Found in
2019.2.0a1
2019.3.0a1
2019.3.0f3
2020.1.0a1
Issue ID
1205928
Regression
No
Undo/Redo action invalidate SerializedObject in Inspector when adding/removing elements in array using SerializedProperty
How to reproduce:
1. Open attached project ("SO-REPRO.zip")
2. Create SerializedObject asset (Assets->Create->BugReport->SO)
3. Select "testasset" asset
4. Open Inspector window
5. Press + sign multiple times
6. Perform undo action multiple times (CTRL-Z or Edit->Undo Inspector)
7. Press + sign multiple times
Expected result: First and further Undo/Redo calls are performed as expected
Actual result: First Undo/Redo isn't performed
Reproducible with: 2019.2.17f1, 2019.3.0f3, 2020.1.0a17
Not tested with: 2017.4.35f1, 2018.4.15f1 (no suitable method found to override CreateInspectorGUI())
Notes:
- After Undo/Redo call first + (add) action isn't performed
- After Undo/Redo call last entry - (remove) action isn't performed at all
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2020.1.X):
When reacting to Undo.undoRedoPerformed, the serializedObject has not been updated by the inspector just yet. The workaround is to either wait until the next frame so the inspector has updated the serializedObject, or do it ourselves.
From 19.3, one can use a ListView with serializedObjectBindings to automatically refresh arrays.