I am using primeng p-virtualScroller for implementing loading data with scroller.It is working fine.But I am facing the below issue: When the search result is less still it shows the scroller and emplty list items. Below is the code I am using in Html:
<p-virtualScroller [(value)]="employeeList" scrollHeight="300px" [itemSize]="20" [rows]="pageSize"
[(lazy)]="lazyLoading" (onLazyLoad)="loadCarsLazy($event)" [(totalRecords)]="totalEmployees">
<ng-template let-emp pTemplate="emptymessage" *ngIf="searchResultMsg">
<span>{{searchResultMsg}}</span>
</ng-template>
<ng-template let-emp pTemplate="item" let-odd = odd *ngIf="searchResultMsg===''">
<div (click)="selectEmployee(emp)" class="pl-2 search-list" [class.odd-row]="odd">{{emp.name}} </div>
</ng-template>
</p-virtualScroller>