Skip to content

Commit

Permalink
fix(accordion): Panel isn't resizing after content has changed
Browse files Browse the repository at this point in the history
fixes #454

Example: http://plnkr.co/edit/Y5CKUFEchwov0LdgT6rZ
1. Open accordian
2. Mulple click add button
3. Button was hidden
  • Loading branch information
mik-laj authored and valorkin committed Apr 26, 2016
1 parent a177e1e commit 914ae1a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/collapse/collapse.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Directive, OnInit, ElementRef, Input, HostBinding} from 'angular2/core';
import {Directive, OnInit, ElementRef, Input, HostBinding, Renderer} from 'angular2/core';
import {AnimationBuilder} from 'angular2/src/animate/animation_builder';
// fix: replace with // 'angular2/animate';
// when https://github.com/angular/angular/issues/5984 will be fixed
Expand Down Expand Up @@ -42,11 +42,12 @@ export class Collapse implements OnInit {

private _ab:AnimationBuilder;
private _el:ElementRef;
private _renderer:Renderer;

public constructor(_ab:AnimationBuilder, _el:ElementRef) {
public constructor(_ab:AnimationBuilder, _el:ElementRef, _renderer: Renderer) {
this._ab = _ab;
this._el = _el;

this._renderer = _renderer;
}

public ngOnInit():void {
Expand Down Expand Up @@ -120,7 +121,8 @@ export class Collapse implements OnInit {
.onComplete(() => {
this.isCollapse = true;
this.isCollapsing = false;
this._el.nativeElement.style.overflow = 'visible';
this._renderer.setElementStyle(this._el.nativeElement, 'overflow', 'visible');
this._renderer.setElementStyle(this._el.nativeElement, 'height', 'auto');
});
}, 4);
}
Expand Down

0 comments on commit 914ae1a

Please sign in to comment.