Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse doesn't take account of element's height #372

Closed
rob-myers opened this issue Apr 4, 2016 · 3 comments
Closed

Collapse doesn't take account of element's height #372

rob-myers opened this issue Apr 4, 2016 · 3 comments

Comments

@rob-myers
Copy link

Consider the following example, where initially collapsed = msgShown = false:

<div [collapse]="collapsed">
    <div *ngIf="msgShown">
        Message text
    </div>
    <div>
        Main text
    </div>
</div>

Setting msgShown = true appears to replace "Main text" by "Message text", rather than showing them both. This is because the height of the outermost div is not updated, effectively hiding "Main text".

Cheers.

@likerRr
Copy link

likerRr commented Apr 4, 2016

Confirmed, faced with the same issue when played with nested collapsible components. Once nested collapse is open, parent collapse doesnt recalculate own height which causes partial hiding of nested collapse's content.

Please, take into account this case too. Thx!

@rob-myers
Copy link
Author

For anyone else faced with this issue, one can alter collapse.component.ts by uncommenting:

@HostBinding('style.height')
  private height:string;

and also:

this.height = 'auto';

in the public method "show".

Edit Additionally, change the two timeouts milliseconds from 4 to 50.

@likerRr
Copy link

likerRr commented Apr 6, 2016

@valorkin Any updates here? Solution provided by @rob-myers doesn't work in my case. Host's height doesn't recalculate if child's content height was increased dynamically (e.g. some elements was added to list)

JohanSmolders pushed a commit to JohanSmolders/ng2-bootstrap that referenced this issue Apr 26, 2016
…ftware#433)

This fix helped me resolve 2 issues - collapse now expands all the way and takes component height into consideration, and also popups like datepicker aren't "cut-off" on component's edge.
fixes valor-software#372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants