I am using <cdk-virtual-scroll-viewport>
with a fixed items size for virtual scrolling.
Furthermore I use ActiveDescendantKeyManager
provided by CDK A11y to move with the arrow keys inside the viewport.
When I try to use both of them I have the following issue:
Since virtual scroll only loads partial information and loads more when you scroll (recycling the view), ActiveDescendantKeyManager
only get the indexes of the current items loaded by the <cdk-virtual-scroll-viewport>
. As I load more, the indexes repeats themselves, since the virtual scroll adds and deletes items, keyManager
just acts weird, since I want the indexes to be in order (if I have 5000 items I want the indexes to be in order, not only from 1-24 and each time I scroll they repeat).
Here is an example on stackblitz
My question is: Is there any way to work with both of them? since what I am trying to do is to move with the arrow keys to the following scroll index.