I'm submitting a ... (check one with "x")
[ ] bug report => Search github for a similar issue or PR before submitting
[x] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
When p-accordionTab is closed it's contents persist in DOM tree.
Destroy p-accordionTab subtree when tab is not opened using *ngIf structural directive.
What is the motivation / use case for changing the behavior?
I use accordion component to display complex, grouped data and have a datatable, buttons and some summary in each accordion tab. When I explore accordion structure I see about 1000 DOM elements and 90% of them are hidden when no accordion tab is opened. A simple *ngIf here at div.ui-accordion-content-wrapper will have a huge performance impact.
This could be an optional setting, but I don't think it should just replace the current behavior. There are plenty of reverse cases where you want the collapsed tabs to persist so the view's state is maintained.
We need to make this configurable by lazy="true|false" that defaults to true for backward compatibility.