Search Issue Tracker
By Design
By Design in 6000.4.X
Votes
0
Found in
6000.0.59f1
6000.2.8f1
6000.3.0b6
6000.4.0a3
Issue ID
UUM-122358
Regression
No
[UI Toolkit] Missing documentation about RegisterValueChangedCallback being fired on entering Play Mode for Values using SerializedObject data binding
Steps to reproduce:
- Open the attached project
- Open the TestScene
- Observe the Game view: in-game UI displays a text field with a value "test", which is bound to the BasicSO scriptable object
- Select the BasicSO object in the Project view and verify that the values match
- Enter Play Mode
- Observe the Console window
Actual results: Despite no visual changes occurring, ValueChangedCallback is triggered. This behaviour is not documented
Expected results: Data binding sections mention ValueChangedCallback being triggered on entering Play Mode when using Two-Way or To-Target bindings
Reproducible with versions: 6000.0.59f1, 6000.2.8f1, 6000.3.0b6, 6000.4.0a3
Tested on (OS): macOS 26.0.1
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
- "Shader warning in 'Hidden/Light2D': implicit truncation of vector type" is thrown when building Universal 2D template
- AI Assistant breaks compilation of packages using System.Runtime.CompilerServices.Unsafe via auto-referencing
- Unity Hub checks the "Documentation" module by default on the 6.4 and 6.5 streams despite that it was unchecked with the previous installs
- Shortcut that toggles between Dopesheet and Curves Views in the Animation Window's Timeline is mislabed
- Property List Items Overlap onto the Property List's top edge when scrolling through a long Property List
Resolution Note:
When entering play mode, the UI will be regenerated. Since the target TextField in the UXML file did not set a value, it will use the default one, which is an empty string.
When the binding is applied, it will set the value coming from the data source and if it is different, it will fire the value changed callback. This is all expected.
So although there might not be a visual change occurring, a change has indeed occurred.
As a side note, OnEnable/OnDisable should be prioritized to query elements and perform configuration. This is because the UIDocument will generate the UI on OnEnable and release it on OnDisable.
Resolution Note (6000.4.X):
When entering play mode, the UI will be regenerated. Since the target TextField in the UXML file did not set a value, it will use the default one, which is an empty string.
When the binding is applied, it will set the value coming from the data source and if it is different, it will fire the value changed callback. This is all expected.
So although there might not be a visual change occurring, a change has indeed occurred.
As a side note, OnEnable/OnDisable should be prioritized to query elements and perform configuration. This is because the UIDocument will generate the UI on OnEnable and release it on OnDisable.