Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

feat(collapse): expand to style-defined height #6045

Closed
uecasm opened this issue Jun 23, 2016 · 1 comment
Closed

feat(collapse): expand to style-defined height #6045

uecasm opened this issue Jun 23, 2016 · 1 comment

Comments

@uecasm
Copy link

uecasm commented Jun 23, 2016

If you define a fixed height on a particular panel via the CSS height attribute in a class or id-based style, but then also want to make it collapsible by adding uib-collapse to it, then it expands to the content height, not the style height. (In some prior versions it would initially start at the style height, then collapse as expected, but then re-expand to the content height.)

This is different behaviour from the Bootstrap collapse.

It's possible to make the angular-ui version behave as expected by replacing the target heights of the expansion with the empty string rather than auto or a specific value -- this makes it expand to the inherited height from the style as expected.

Example plunker.

Ideally the directive should just automatically behave like the bottom one -- this is consistent with Bootstrap, where it will automatically use a fixed height if one is provided or an auto height otherwise, as you'd expect. (Try it by removing the fixed-height style or its height attribute.) If there's some reason why an explicit auto is required (it doesn't seem to be in desktop Chrome at least) then perhaps there should be an option to select between the two behaviours.

The bottom one was based on the angular-ui code as of 1.3.3, changing only four lines (other than the directive name).

@wesleycho
Copy link
Contributor

This sounds like a bug - we set it to auto by default, but that probably should only be if we don't have a height. We probably shouldn't be in the business of setting the height (or width).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants