Skip to content

Commit

Permalink
fix(collapse): fix setting display value (#6257)
Browse files Browse the repository at this point in the history
* fix(collapse): fix setting display value

* fix(collapse): fixed dynamic display value
  • Loading branch information
SvetlanaMuravlova authored Sep 7, 2021
1 parent da3f6df commit aaf1240
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/collapse/collapse.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,15 @@ export class CollapseDirective implements AfterViewChecked {

@Input()
set display(value: string) {
if (!this.isAnimated) {
this._renderer.setStyle(this._el.nativeElement, 'display', value);

return;
}

this._display = value;

if (value === 'none') {
this.hide();

return;
}

this.show();
this.isAnimated ? this.toggle() : this.show();
}

/** turn on/off animation */
@Input() isAnimated = false;
/** A flag indicating visibility of content (shown or hidden) */
Expand Down

0 comments on commit aaf1240

Please sign in to comment.