Skip to content

Commit

Permalink
Merge pull request #16327 from primefaces/issue-16326
Browse files Browse the repository at this point in the history
Fixed #16326 - Panel component -> toggle from the outside
  • Loading branch information
mehmetcetin01140 authored Sep 10, 2024
2 parents bc7accd + f646ffe commit 41dd18b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/components/panel/panel.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<PrimeTemplate>).forEach((item) => {
Expand Down Expand Up @@ -267,7 +267,8 @@ export class Panel implements AfterContentInit, BlockableUI {
if (this.collapsed) this.expand();
else this.collapse();
}


this.cd.markForCheck()
event.preventDefault();
}

Expand Down

0 comments on commit 41dd18b

Please sign in to comment.