Resizable
from the re-resizable
package is preventing my Flatlist from scrolling. When the list has enough elements to require scrolling, it doesn’t start to scroll. This behavior doesn’t happen when the resizable element isn’t there. The documentation for Resizable doesn’t mention scrolling.
<Resizable
style={style.mainViewExpanded}
defaultSize={{
width: 300,
height: 300,
}}
maxHeight="80vh"
maxWidth="600"
minWidth="300"
minHeight="300"
enable={{
top: true,
right: false,
bottom: false,
left: true,
topRight: false,
bottomRight: false,
bottomLeft: false,
topLeft: true,
}}
>
<FlatList
data={parsedPacks}
keyExtractor={(item) => item.packName}
renderItem={({item}) => (
<PackListItem
packName={item.packName || pack}
content={item.content}
/>
)}
/>
</Resizable>
Styles:
mainViewExpanded: {
overflow: 'hidden',
height: 300,
width: 300,
backgroundColor: theme.BGSECOND,
borderStyle: 'solid',
borderRadius: 10,
borderWidth: 2,
borderColor: theme.FIRST,
},
2
Answers
I found the issue.
overflow
when set tohidden
will prevent scrolling. This is documented in the CSS documentation. The was to solve this problem is by either settingoverflow
toauto
,hidden visible
orvisible hidden
depending on the situation. The reason is becauseoverflow
is a shorthand foroverflow-x
andoverflow-y
. The first word in the value is forx
, and the second is fory
.The best way to handle scroll is to add
or
..depending on your data to