Search Issue Tracker
Won't Fix
Votes
0
Found in
2022.3.59f1
6000.0.41f1
6000.1.0b9
6000.2.0a6
Issue ID
UUM-99286
Regression
No
LayoutGroup evaluates ILayoutIgnorer property when the Component is disabled
Reproduction steps:
1. Open the attached “IN-93702.zip” project
2. Open the “SampleScene”
3. Select the “TestLayout” GameObject from the Hierarchy
4. In the Inspector, find the “Test Layout Ignorer (Script)” Component
5 Make sure that the Component and the “Ignore Layout” property are disabled
6. Enter the Play mode
7. Observe the layout of the Images
8. Exit the Play mode
9. Enable only the “Should Ignore Layout” property
10. Enter the Play mode
11. Observe the layout of the Images
Expected result: The layout of the Images does not change compared between 7th and 11th steps
Actual result: The layout changes even though the Component is disabled
Reproducible with: 2022.3.59f1, 6000.0.41f1, 6000.1.0b9, 6000.2.0a6
Reproducible on: Windows 11
Not reproducible on: no other environment tested
Note:
- Related discussions page: https://discussions.unity.com/t/layoutgroup-checks-disabled-ilayoutignorer-components-for-their-value/1583997
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
- Font character thickness does not adjust properly in UI Toolkit text when changing Bold Weight in Font Asset
- Multiple "[...] is inaccessible due to its protection level" errors are thrown when opening project with Unity Version Control installed
- Sorting icons are tiny and misaligned in Import Activity window
- The Undo system does not record HideFlags.HideInHierarchy changes
- [Linux] Bug Reporter window is in Light mode when the Editor theme is Dark mode
Resolution Note:
It is possible to workaround this by including a check to `enabled` in the `ILayoutIgnorer.ignoreLayout` property, like so:
```public bool ignoreLayout => enabled && shouldIgnoreLayout;```
Changing this behavior is too risky and could break other users. We will update the documentation of `ILayoutIgnorer` to reflect that it runs on disabled components as well.