diff --git a/src/app/components/panel/panel.ts b/src/app/components/panel/panel.ts index 2b6e7706c91..4785fab9efe 100755 --- a/src/app/components/panel/panel.ts +++ b/src/app/components/panel/panel.ts @@ -1,6 +1,6 @@ import { animate, state, style, transition, trigger } from '@angular/animations'; import { CommonModule } from '@angular/common'; -import { AfterContentInit, ChangeDetectionStrategy, Component, ContentChild, ContentChildren, ElementRef, EventEmitter, Input, NgModule, Output, QueryList, TemplateRef, ViewEncapsulation, booleanAttribute } from '@angular/core'; +import { AfterContentInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ContentChildren, ElementRef, EventEmitter, Input, NgModule, Output, QueryList, TemplateRef, ViewEncapsulation, booleanAttribute } from '@angular/core'; import { BlockableUI, Footer, PrimeTemplate, SharedModule } from 'primeng/api'; import { MinusIcon } from 'primeng/icons/minus'; import { PlusIcon } from 'primeng/icons/plus'; @@ -211,7 +211,7 @@ export class Panel implements AfterContentInit, BlockableUI { return this.header; } - constructor(private el: ElementRef) {} + constructor(private el: ElementRef, private cd: ChangeDetectorRef) {} ngAfterContentInit() { (this.templates as QueryList).forEach((item) => { @@ -267,7 +267,8 @@ export class Panel implements AfterContentInit, BlockableUI { if (this.collapsed) this.expand(); else this.collapse(); } - + + this.cd.markForCheck() event.preventDefault(); }