primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.48k stars 4.6k forks source link

P-Splitter: Can't change template visibility at runtime #15940

Open R0binSmit opened 4 months ago

R0binSmit commented 4 months ago

Describe the bug

I have probably found a bug in the P-Splitter. The misbehaviour relates to the restriction of the visibility of individual areas within the P-Splitter. If I define a P-Splitter with two defined areas, I can restrict the visibility of the areas using the "ng-templates" & "ngIf" (see test case 1 from my example). However, it is not possible to change the visibility at runtime (see test case 2 from my example). There I used "setTimeOut" to change the visibility of an area to "hidden" after 5 seconds. However, this has no influence on the DOM.

Environment

Reproducer

https://stackblitz.com/edit/stackblitz-starters-onvsgv

Angular version

18.0.0

PrimeNG version

17.18.2

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

17.18.2

Browser(s)

No response

Steps to reproduce the behavior

  1. Implement a P-Splitter with two templates
  2. Restrict the visibility of one template by "*ngIf" and a boolean
  3. Change the visibility restriction at runtim (by setTimeOut for example)

Expected behavior

After changing the Boolean value in *ngIf, the change is taken into account and the DOM is adjusted accordingly (set template visibility).

mehmetcetin01140 commented 4 months ago

Hi, as a workaround until the issue is fixed, you can use this: https://stackblitz.com/edit/stackblitz-starters-ptlv7q?file=src%2Fmain.ts.

R0binSmit commented 4 months ago

Thanks for your quick response. The workaround works fine 👍.

Logic-Bits commented 4 months ago

would be nice to have a direct solution, *ngIf or @if doesnt work with the pTemplate

github-actions[bot] commented 6 days ago

This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment!