Set height of Flex Accordion to height of tallest child

Posted by Mike Deck on Stack Overflow See other posts from Stack Overflow or by Mike Deck
Published on 2010-04-05T19:06:34Z Indexed on 2010/04/05 20:03 UTC
Read the original article Hit count: 216

Filed under:
|

By default the height of an Flex Accordion container is the height of the initially selected child. I'd like to be able to set the height to the tallest child so that no resizing or scrolling is necessary when other children are selected.

I do not want to use the resizeToContent property. I want the size of the container to stay constant no matter what child is selected.

My current thought is to extend the accordion class setting the creation policy to "all" and then override the measure function to loop through all the children and find the tallest one and use that for the height. This seems a little kludgy though, so I'd like to know if there is a better approach.

Ultimately my question is: is there a way to set the size of an accordion container such that the container never resizes and scoll bars are never necessary to display any of the children?

© Stack Overflow or respective owner

Related posts about flex

Related posts about layout