bamlab / react-tv-space-navigation

A React Native module to handle spatial navigation for a TV application in a 100% cross-platform way
https://bamlab.github.io/react-tv-space-navigation/
MIT License
205 stars 18 forks source link

Can I put a VirtualizedList inside a VirtualizedList? #158

Open Yria opened 1 week ago

Yria commented 1 week ago

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.