I have a dropdown menu inside all items in FlatList However, the menu from the last item will cut off by the FlatList container.
After debugging on Chrome, I found that adding overflow: 'visible'
to FlatList's div
works. But I have no way to override it.
I tried
<FlatList
...others
contentContainerStyle={{ overflow: 'visible' }}
/>
and
<FlatList
...others
style={{ backgroundColor: 'red', overflow: 'visible' }}
/>
but none of it work.
Here's what I see in Chrome inspector
<div> // style changes backgroundColor here, but ignoring overflow
<div /> // contentContainerStyle changes this div
</div>
Heres my code:
<FlatList
ref='flatList'
data={data}
extraData={someData}
keyExtractor={item => item.id.toString()}
renderItem={this.renderItem}
CellRendererComponent={({ children, index, style, ...props }) => {
return (
<View style={[style, { zIndex: data.length - index }]} index={index} {...props}>
{children}
</View>
)
}}
style={{ overflow: 'visible', backgroundColor: 'red' }}
enableEmptySections
/>