Layout groups/Content size fitters not working when parent is disabled

I’m running into a problem where I need to access the position of an object that is being organized by a layout group, but the objects position comes out as 0 on all axis, this is because I’m instantiating all these objects at runtime inside of a layout group whose parent is disabled (the object containing the layout group is enabled). The layout group doesn’t seem to update itself not matter what I do while its parent is disabled. This leads to its children not being in the correct position and also an obnoxious 1 frame flash when the group is enabled where everything is out of place.

The only way I’ve found to fix this without writing a similar component by yourself is to enable the group for 1 frame and disable it again, which feels horrible to do. Is there anyway to force it to update itself?

So far I’ve tried forcing the canvas to update, forcing the layout group to rebuild and also marking it for rebuild, none of these work.

I believe the cleanest way resolve issues like this is to place a CanvasGroup element at the root with the Canvas element and set its opacity to 0%. Let the single frame of janked layout pass with an async function of your choice (coroutine, async await, or UniRx), and then reset opacity to 100%. Still a hack, but that’s UGUI.