Lazy Loading for Accordion and TabView #1808

ilianiv opened this Issue Jan 13, 2017 · 2 comments


None yet

3 participants

ilianiv commented Jan 13, 2017

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
[ ] support request => Please do not submit support request here, instead see

Current behavior
When p-accordionTab is closed it's contents persist in DOM tree.

Expected behavior
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.

  • Angular version: 2.4.1
  • PrimeNG version: 1.1.3
  • Browser: [all]
  • Language: [all]

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.

@cagataycivici cagataycivici self-assigned this Jan 17, 2017
@cagataycivici cagataycivici added this to the 2.0 milestone Jan 17, 2017
@cagataycivici cagataycivici changed the title from Use *ngIf in p-accordionTab for better performance to Lazy Loading for Accordion and TabView Jan 17, 2017
@cagataycivici cagataycivici added a commit that closed this issue Jan 17, 2017
@cagataycivici cagataycivici Fixed #1808 23a885e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment