How do I make "Fit-to-content" Dynamic Panels expand up when changing states?

Fit-to-content dynamic panels by default expand down. So if you have a 30px height for state 1, and a 60px height for state 2, when switching states the top of panel will stay fixed and the panel expands 30 px below. For my prototype I need the panel to expand up. Is there a way I can do this?

Hi lunchparr - a simple answer is ‘no’ - it will always fit-to-content from the top left.
But there’s a fairly straightforward workaround using a bit of maths.

Could be a better way… :slight_smile:

Demo here with notes.

File here.

dp_fittocontent_pinnedtobottom.rp (64.6 KB)

1 Like

If I’m understanding you correctly try this:

Position your shorter panel’s widgets so that their bottom edge is at the same y position (60?) as the taller panel’s widget’s bottom edge y position.