The VLG component does not expand regardless of the length of the child

Hi, this is my hierarchy:

  • Vertical Layout Group

  • ScrollView (Horizontal)

  • Text (Variable width)

I would like the ScrollView to expand horizontally until it touches the limits of the Vertical Layout Group.
This I would be able to do by enabling “Control Child Size” and “Child Force Expand”.

However, I would like one more thing, which is that the ScrollView does not expand beyond the limits of the Vertical Layout Group. This problem is caused when the Text component (of variable size) will be longer than the length of the Vertical Layout Group.

I would therefore like the ScrollView to expand into the Vertical Layout Group, without being influenced by the size of the child.

The solution can be found here:

https://stackoverflow.com/questions/68741641/the-vlg-component-does-not-expand-regardless-of-the-length-of-the-child