diff --git a/src/framework/theme/components/accordion/accordion-item-body.component.ts b/src/framework/theme/components/accordion/accordion-item-body.component.ts index 21791db65a..2e136f8e08 100644 --- a/src/framework/theme/components/accordion/accordion-item-body.component.ts +++ b/src/framework/theme/components/accordion/accordion-item-body.component.ts @@ -8,7 +8,6 @@ import { Component, ChangeDetectionStrategy, Host, - ElementRef, ChangeDetectorRef, OnInit, OnDestroy, @@ -32,9 +31,7 @@ const accordionItemBodyTrigger = trigger('accordionItemBody', [ style({ overflow: 'hidden', visibility: 'visible', - height: '{{ contentHeight }}', }), - { params: { contentHeight: '1rem' } }, ), transition('collapsed => expanded', animate('100ms ease-in')), transition('expanded => collapsed', animate('100ms ease-out')), @@ -46,7 +43,7 @@ const accordionItemBodyTrigger = trigger('accordionItemBody', [ @Component({ selector: 'nb-accordion-item-body', template: ` -
+
@@ -56,23 +53,15 @@ const accordionItemBodyTrigger = trigger('accordionItemBody', [ changeDetection: ChangeDetectionStrategy.OnPush, }) export class NbAccordionItemBodyComponent implements OnInit, OnDestroy { - - contentHeight: string; - private alive: boolean = true; - constructor( - @Host() private accordionItem: NbAccordionItemComponent, - private el: ElementRef, - private cd: ChangeDetectorRef) { - } + constructor(@Host() private accordionItem: NbAccordionItemComponent, private cd: ChangeDetectorRef) {} get state(): string { return this.accordionItem.collapsed ? 'collapsed' : 'expanded'; } ngOnInit() { - this.contentHeight = `${this.el.nativeElement.clientHeight}px`; this.accordionItem.accordionItemInvalidate .pipe(takeWhile(() => this.alive)) .subscribe(() => this.cd.markForCheck());