Search Issue Tracker
By Design
Votes
0
Found in
2022.3.33f1
6000.0.7f1
Issue ID
UUM-74679
Regression
Yes
PropertyField with range attribute triggers change event when the value didn't change
Reproduction steps:
1. Open the attached “BugRepro” project
2. In the Editor, navigate to Test > My Editor Window
3. Observe the Console window
Expected result: The change callback is called when the value is changed in the UI
Actual result: The change callback for the property with the Range attribute is called upon field creation even though the value didn't change.
Reproducible with: 2022.1.0a13, 2022.3.33f1, 6000.0.7f1
Not reproducible with: 2021.3.39f1, 2022.1.0a12
Reproducible on: Windows 11
Not reproducible on: No other environment tested
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
- [Search] Query Builder - uneditable NaN in Transform vectors
- Transform.rotation property is as a Vector4 Quaternion instead of a Vector3 field when using InspectorElement.FillDefaultInspector
- [Search] Query Builder - "Input String was not in a correct format" error when changing query options
- MacOS Xcode project build fails when a package has PrivacyManifest
- [IL2CPP] Crash when closing the Player while an exception is thrown during exception handling
Resolution Note:
The Bind operation to the SerializedObject is done automatically, but is executed after the CreateGUI call, to allow users to create their UI fully before we bind it.
Binding a SerializedProperty to a field will always trigger a value change event, because the value is now coming from the serialized data and we need to inform users that this as changed, even if the value is the same. As a result, this value change after initialization of PropertyFields is expected. Still, we are planning to improve this in future versions.
A workaround to skip it is to schedule the registration to the next update like so: myPropertyField.schedule.Execute(/* registration */);