Aha… I see what you are saying now. I failed to test this thoroughly. In my prototype, clicking back and forth on the Fruits and the Vegetables buttons to swap these filters does work. But, once the dynamic panel exceeds the maximum height (Show All button clicked and all filters removed) and the conditional case in the Resized event triggers the dynamic panel to be sized with Set Size it no longer works.
So, it looks like the dynamic panel’s Fit to Content setting does not work after the dynamic panel is resized with a Set Size action. This could be considered a bug because I doubt most users would expect it to work this way. However, I can envision scenarios where someone wants the dynamic panel to fit to content only until some user or system event and no longer after that …but that likelihood is probably very small. I’d say it is at least a feature request for support@axure.com to change this behavior, if possible.
My first workaround attempt was to assign an additional conditional case that handles “less than or equals” the max height, setting the dynamic panel to the height of the repeater (see Page 2 of the updated .rp file below.) This did not work, and it seems to have created a critical problem in which the repeater filters no longer work, and at least once the prototype player locked up in the browser–I couldn’t change pages.
My second workaround attempt seems to work well enough. I removed the Set Size actions from the dynamic panel, and instead created an outer dynamic panel from the existing dynamic panel. On this outer panel, I unchecked Fit to Content so it’s size remains fixed. I assigned a “Scroll Vertically” setting to this panel. So, the inner dynamic panel resizes automatically based on its content–the repeater height–and when it is larger than the max, the outer dynamic panel masks this “overflow”. See Page 3 of the updated .rp file below.
resize dynamic panel with max height.rp (141.4 KB)