Search Issue Tracker
By Design
Votes
1
Found in
2022.1.17f1
2022.2.0b8
2023.1.0a11
Issue ID
UUM-14819
Regression
Yes
Callback methods are not called when the element is removed during “clicked” event
Reproduction steps:
1. Open the user’s attached project
2. Open Assets/Scenes/Sample Scene
3. Enter Play mode
4. Press the “Open Panel” button
5. Press the “Play SFX” button
6. Press the “Close Panel and Play SFX” button
7. Press the “Open Panel” button
8. Press “Play SFX and Close Panel”
Expected result: The sound can be heard when pressing all buttons
Actual result: The sound is only heard when the “Play SFX” button is pressed
Reproducible with: 2022.1.0a14, 2022.1.17f1, 2022.2.0b8, 2023.1.0a11
Not reproducible with: 2020.3.39f1, 2021.3.10f1, 2022.1.0a13
Reproducible on: macOS 12.5.1
Note: To reproduce this issue on 2020.3.39f1 UI Toolkit needs to be added as a package through Package Manager
Comments (1)
-
kamil-dawidow
Oct 20, 2022 08:14
This issue is still affecting our project. What's the ETA on a fix?
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
- Spots of bad lighting appear on assets when the lighting is generated in a Scene
- Static Editor Flags dropdown list is cut off when Inspector Window is docked to the very right and UI Scaling is set to a higher value
- visionOS Players are minimized when Guided Access is turned on
- Licensing Client fails to launch when opening Unity Hub
- Sprite Atlas Inspector preview disappears when entering Play mode unless SpriteAtlasMode is set to "Sprite Atlas V2 - Enabled"
Resolution Note:
This is working as intended. Elements don't receive events when they're removed from their parent panel. The PR identified as introducing a regression enforced this behavior which was a fix to another bug.
Furthermore, in the repro project, button.clicked and button.RegisterCallback<ClickEvent>() are used as though they were synonymous, but they are not. One always happens before the other, and stopping one doesn't stop the other. Removing an element from its panel between the two should prevent the last of the two from being called.