Search Issue Tracker
Fixed
Votes
1
Found in [Package]
Issue ID
1030987
Regression
No
[UI] CanvasGroup Interactable field value is not applied on element creation when element is not a direct child of CanvasGroup
To reproduce:
1. Open any project
2. Create a UI panel named "GroupParent" and add CanvasGroup component
3. Uncheck the CanvasGroup Interactable field (make it non interactable)
4. Add a Button child to "GroupParent" - child becomes non interactable
5. Add an empty child to "GroupParent" and then add a Button child to the empty child
Expected: all UI elements, that are under CanvasGroup hierarchy become greyed out due to Interactable field value being false
Actual: UI elemets, that are not direct children of the CanvasGroup element do not have the Canvas group values applied on creation
Reproduced in: 2017.2.3f1, 2017.4.3f1, 2018.1.0f2, 2018.2.0b3
Note: entering Play mode fixes the issue, can also be fixed when changing any Canvas Group setting forcing it to reapply the settings
Comments (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
- "MissingReferenceException" error is thrown when creating a new "Standard (URP)" scene
- Silent crash when opening a specific project
- "+" shaped artifacts are rendered on UI Toolkit Buttons when the border radius is over 50%, button's opacity is set to 1 and the border has width
- All references to Sprite Atlas and AssetReferenceAtlasedSprite are removed when migrating Sprite Atlas Mode from V1 to V2
- URP ShadowCaster2D is misplaced and distorted when used with rotated Perspective Camera
paulatwarp
Jul 31, 2018 09:09
This also happens if you add a button to an existing CanvasGroup while the game is running. I submitted an issue and it's been marked a duplicate of this.
Here's my test project:
https://github.com/paulsinnett/CanvasGroupBug
A fix for this issue is to send the message OnCanvasGroupChanged to the newly created Button.
I found this issue by tracking down a bug in some menu code where buttons would apparently lose focus. What happened was the UI navigating to "inactive" buttons on hidden canvases.