Calendar performance issues #1781
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone
I'm submitting a ... (check one with "x")
Current behavior
Render speed is very slow when there are a large number (100+) of Calendar components on the page.
Expected behavior
Should be little to no lag to render.
Suggested fix is to only render of the calendar overlay when necessary (currently its rendered, but hidden with display: none;). I found that this dramatically sped up render times.
Minimal reproduction of the problem with instructions
Add this to the calendardemo.html template:
<button (click)="perfTest()">Perf Test
<div *ngIf="isPerfTest">
<p-calendar *ngFor="let i of arr" [(ngModel)]="date1">
And in the CaledarDemo component class:
export class CalendarDemo {
isPerfTest: boolean;
arr = Array(100).fill(1);
...
perfTest() {
this.isPerfTest = !this.isPerfTest;
}
Please tell us about your environment:
Windows 10
Angular version: 2.X.X
PrimeNG version: 1.1.4
Browser: all
The text was updated successfully, but these errors were encountered: