Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I put a VirtualizedList inside a VirtualizedList? #158

Open
Yria opened this issue Sep 27, 2024 · 1 comment
Open

Can I put a VirtualizedList inside a VirtualizedList? #158

Yria opened this issue Sep 27, 2024 · 1 comment
Labels
bug Something isn't working feature request

Comments

@Yria
Copy link

Yria commented Sep 27, 2024

If you use a virtualizedList inside a virtualizedList, only one or the other will scroll.

example)

<SpatialNavigationVirtualizedList
	data={[mock, mock, mock, mock, mock, mock, mock, mock]}
	orientation={'vertical'}
	renderItem={({ item }) => (
	    <SpatialNavigationVirtualizedList data={item} orientation="horizontal">
	        {({ item }) => (
	            <Program src={item} />
	        )}
	    </Section>
	)}
	itemSize={scaledPixels(250)}
	numberOfRenderedItems={6 + 2}
	numberOfItemsVisibleOnScreen={6}
scrollBehavior="stick-to-start"
 />

When used as above, vertical scrolling works fine, but horizontal scrolling does not.

The horizontal list is drawn as it appears on the screen, but the vertical list is not.

In example, you are using scrollview for the vertical and listview for the horizontal, but this does not draw what is visible on the screen.

@pierpo
Copy link
Member

pierpo commented Oct 9, 2024

Hey @Yria!
Indeed, this should work... but it doesn't. It needs investigation, but it's quite a tricky one.

However, I think the performance will be quite bad anyway. Since on each scroll we mount/unmount an element (with recycling in the case of simple lists), then scrolling through a virtualized list of virtualized lists means you will mount/unmount a whole list everytime you scroll through the parent one.

Still, it's not normal that it doesn't work. We were aware of this, but we didn't track it indeed.

Thank you for reporting it!

@pierpo pierpo added the bug Something isn't working label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature request
Projects
None yet
Development

No branches or pull requests

2 participants