Search Issue Tracker
By Design
By Design in 2023.3.X
Votes
0
Found in
2022.3.8f1
2023.1.10f1
2023.2.0b6
2023.3.0a2
Issue ID
UUM-46857
Regression
No
RegisterValueChangedCallback raised for parent element when it is raised for child if they both use it
Reproduction steps:
1. Open the attached project "Bug-INotifyValueChanged"
2. Click "Tests/INotifyValueChanged Bug Window" in the menu bar
3. Expand the "Foldout" in the TestWindow
4. Click the "Value" checkbox in the TestWindow
Expected result: The Console logs "Foldout 'ValueChanged' raised with value: True" and "Toggle 'ValueChanged' raised with value: True"
Actual result: The Console logs: "Foldout 'ValueChanged' raised with value: True", "Toggle 'ValueChanged' raised with value: True" and "Foldout 'ValueChanged' raised with value: True"
Reproducible with: 2021.3.29f1, 2022.3.8f1, 2023.1.10f1, 2023.2.0b6, 2023.3.0a2
Reproducible on: macOS 13.4.1 (Intel), Windows 10 (user’s)
Not reproducible on: No other environment tested
Note: not reproducible if not using RegisterValueChangedCallback with the "Foldout" - comment lines 23-28 of TestWindow.cs
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
- [macOS] Editor crashes after entering Play mode with overlapping GameObjects with Cloth Component and Cloth Inter-Collision enabled
- Look Dev constantly regenerates the default Volume Profile when set to "None" instead of using the default one
- Look Dev errors are spammed when opening a new HDRP project when Look Dev was added to the layout in the previous project
- URP Scene Templates are not editable when first opened from the New Scene dialog
- Look Dev window flickers when resizing the window after docking it
Resolution Note:
As can be seen on the Unity Manual, the ChangeEvent event bubbles and trickles down, so it will reach parent elements after the child element:
https://docs.unity3d.com/Manual/UIE-Change-Events.html
You can add `evt.StopPropagation()` at the end of the Toggle callback to stop it from reaching the parent and obtain the expected behavior.
Resolution Note (2023.3.X):
As can be seen on the Unity Manual, the ChangeEvent event bubbles and trickles down, so it will reach parent elements after the child element:
https://docs.unity3d.com/Manual/UIE-Change-Events.html
You can add `evt.StopPropagation()` at the end of the Toggle callback to stop it from reaching the parent and obtain the expected behavior.