I'm using ngx-virtual-scroller with a additional toggle component on top. On user toggle additional items are added to virtual scroller.
This results in automatic scroll behaiviour, if items which are added are before current position. If the user is on top, additional items are added below which looks fine. If the user is in the middle it results in unexpected scrolling.
Is it possible to avoid this scrolling?
I would like to lock/freeze the screen/position.
Update: something like
const currentIndex = this.scroller.viewPortInfo.startIndex;
update();
this.scroller.scrollToIndex(currentIndex);
works more or less. It flickers. Sometimes it scrolls back not to exactly same position. So if update operation is done multiple times there is a movement.