Closed alexander-riss closed 3 years ago
our use case is that we would like to allow to e.g. let the outer component know which element range is currently visible, so we could only issue a scrollTo event when an element is requested that is out of view completely
I added three new imperative functions that will allow you to handle this.
getRenderKeys:
https://github.com/adobe/uxp-optimized/blob/92caf1733e69cb924e2eac0793ae2f19e118e535/src/Virtualizer/VirtualizerApi.ts#L24
getItemRect
https://github.com/adobe/uxp-optimized/blob/92caf1733e69cb924e2eac0793ae2f19e118e535/src/Virtualizer/VirtualizerApi.ts#L29
getVisibleRect
https://github.com/adobe/uxp-optimized/blob/6ca2deb2a080d7b2d661794c49b3b320adcbb253/src/Virtualizer/VirtualizerApi.ts#L33
The sample uses these functions and logs the results here:
https://github.com/adobe/uxp-optimized/blob/92caf1733e69cb924e2eac0793ae2f19e118e535/src/devsample/SampleSelector.tsx#L70
our use case is that we would like to allow to e.g. let the outer component know which element range is currently visible, so we could only issue a scrollTo event when an element is requested that is out of view completely