4

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.

Ced
  • 12,657
  • 11
  • 62
  • 124
MichaelShake
  • 108
  • 8
  • I have a very similar problem (and interestingly made a very similar-looking StackBlitz!) https://stackoverflow.com/questions/55696084/indexing-or-selecting-all-viewchildren-within-a-cdk-virtual-scroller Hopefully we can find a solution to this, it's kind of broken! – msanford Apr 16 '19 at 13:10

0 Answers0