i have the following code.
home.html:
<ion-list [virtualScroll]="newDates" approxItemHeight="50px">
<ion-item *virtualItem="let date" id="i">
{{date.holiday}}
</ion-item>
</ion-list>
home.ts:
scrollTo(){
let yOffset = document.getElementById('25').offsetTop;
this.content.scrollTo(0, yOffset);
}
For Example i have to scroll down to i=25
The following method works for normal list without VirtualScroll.
VirtualScroll doesnt display the elements which are not seen on the view hence we get an error yOffset is null