0

I have added virtual scroll to accordion. Inside the accordion I have images with page-number.

I want to scroll to the position where the page number is present once I enter the value in a search box.

I tried adding scrollToView in the javascript way. But since all the pages are not rendered at the same time in virtual scroll into the DOM this logic didnot work. Is there any other way I can scroll to the searched page. Note that the pages are not in the ascending order and the order might differ.

This viewport is in the parent component. Accordion is present in another child component.

<cdk-virtual-scroll-viewport itemSize="50" class="example-viewport">
  <accordion *cdkVirtualFor="let item of items" class="example-item">{{item}}</accordion>
</cdk-virtual-scroll-viewport>

0 Answers0