Search Issue Tracker

By Design

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:

  1. Open the attached project
  2. Open the TestScene
  3. Observe the Game view:  in-game UI displays a text field with a value "test", which is bound to the BasicSO scriptable object
  4. Select the BasicSO object in the Project view and verify that the values match
  5. Enter Play Mode
  6. 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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.