Search Issue Tracker
By Design
Votes
0
Found in
2019.2.0a1
2019.3.0a1
2019.3.0b2
2020.1.0a1
Issue ID
1182679
Regression
No
[UI Elements] Parent element ValueChangedCallback is triggered when changing it's child value
How to reproduce:
1. Open the attached "case_1182679_repro" project
2. In the top menu bar, click on Window -> "BUG REPORT 9"
3. In the appeared window, toggle the "InnerToggle"
4. Check the output in the Console Window
Expected results: The output log is "Clicked" only
Actual results: Both methods are triggered, resulting in "Clicked" and "Foldout value changed" logs
Reproducible with: 2019.2.7f2, 2019.3.0b4, 2020.1.0a5
Additional note: The project on Unity versions 2019.4.9f1 and earlier could not be tested due to missing UIElements
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
- [OpenGLES][XR] Zooming in on the camera's URP opaque texture causes "double vision" on Quest in OpenGLES3
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
Resolution Note:
This is not a bug. ChangeEvent propagates from the event target (the Toggle) up to the root, thus triggering the callback on the Foldout. The Foldout should check the target of the event (evt.target == evt.currentTarget) before doing work related on foldout value change.
evt.currentTarget: the element for which we are executing the callback
evt.target: the element that was the target of the event