Scrolling panel not adjusting to hidden elements
I am currently running into a problem with scrolling panels. I have a scrolling panel that I would like to "stretch" itself, because there are multiple text boxes that are hidden (Hidden state), only to be revealed with certain conditions.
The problem is that the scrolling panel is adjusted with all the free space that the hidden boxes are taking; it doesn't readjust itself with the bar so only that's on Normal state is shown.
Attached is an image:
- The yellow bar is to see where scrolling is required.
- The blue rectangle is where the hidden text
- The red rectangle is the scrolling bar's unadjusted length.
- The requested behavior would be for the bar to stop at the end of the 2) text and then to stretch itself when the 3) text is turned to Normal.
- If I have multiple hidden boxes, the bar would scroll all the way down.
Is there a way to tell the panel to stop a specific line, to adjust itself according to what is visible? I get that using multiple layers and states is doable, but if one thing changes in the text, every single one of these instances must to reviewed and corrected.